Skip to content

Commit db0aa51

Browse files
committed
Update README.md
1 parent e49d669 commit db0aa51

File tree

1 file changed

+85
-40
lines changed

1 file changed

+85
-40
lines changed

README.md

Lines changed: 85 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ AWS_CODE_DEPLOY_REGION
3232
3333
AWS_CODE_DEPLOY_APPLICATION_NAME
3434
35-
AWS_CODE_DEPLOY_DEPLOYMENT_GROUP_NAME
3635
AWS_CODE_DEPLOY_DEPLOYMENT_CONFIG_NAME
36+
AWS_CODE_DEPLOY_MINIMUM_HEALTHY_HOSTS
37+
38+
AWS_CODE_DEPLOY_DEPLOYMENT_GROUP_NAME
39+
AWS_CODE_DEPLOY_SERVICE_ROLE_ARN
40+
AWS_CODE_DEPLOY_EC2_TAG_FILTERS
41+
AWS_CODE_DEPLOY_AUTO_SCALING_GROUPS
3742
3843
AWS_CODE_DEPLOY_APP_SOURCE
3944
@@ -44,6 +49,7 @@ AWS_CODE_DEPLOY_S3_LIMIT_BUCKET_FILES
4449
AWS_CODE_DEPLOY_S3_SSE
4550
4651
AWS_CODE_DEPLOY_REVISION_DESCRIPTION
52+
AWS_CODE_DEPLOY_DEPLOYMENT_DESCRIPTION
4753
```
4854

4955

@@ -54,76 +60,115 @@ AWS_CODE_DEPLOY_REVISION_DESCRIPTION
5460

5561

5662

57-
## AWS Code Deploy Workflow
63+
## AWS Code Deploy Workflow with Variable Information
5864

5965
To deploy an application with AWS Code Deploy, the Wercker step follow this steps :
6066

61-
#### Step 1 : [Configuring AWS](http://docs.aws.amazon.com/cli/latest/reference/configure/index.html)
67+
#### Step 1: [Checking Dependencies]
68+
69+
The following executables are installed:
70+
* python-pip
71+
* aws
72+
73+
#### Step 2: [Configuring AWS](http://docs.aws.amazon.com/cli/latest/reference/configure/index.html)
74+
75+
This step ensures that configuration parameters for AWS cli are properly set.
6276

63-
This initial step consists on configuring AWS.
77+
Environment Variables:
6478

65-
The following configuration allows to setup this step :
79+
* `AWS_CODE_DEPLOY_KEY` (optional): AWS Access Key ID. If not already configured in **aws** cli, this is required.
80+
* `AWS_CODE_DEPLOY_SECRET` (optional): AWS Secret Access Key. If not already configured in **aws** cli, this is required.
81+
* `AWS_CODE_DEPLOY_REGION` (optional): Default region name
6682

67-
* `key` (required): AWS Access Key ID
68-
* `secret` (required): AWS Secret Access Key
69-
* `region` (optional): Default region name
83+
#### Step 3: [Checking Application](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-application.html)
7084

71-
#### Step 2 : [Defining Application](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-application.html)
85+
This step ensures the application exists within Code Deploy. If it does not exist, it will attempt to create the application with the specified name.
7286

73-
This second step consists on defining the application. If the application does not exists this step create the application in Code Deploy.
87+
Environment Variables:
7488

75-
The following configuration allows to setup this step :
89+
* `AWS_CODE_DEPLOY_APPLICATION_NAME` (required): Name of the application to deploy
7690

77-
* `application-name` (required): Name of the application to deploy
78-
* `application-version` (optional): Version of the application to deploy. By default: Short commit id _(eg. fec8f4a)_
91+
#### Step 4: [Deployment Config](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment-config.html) (optional)
7992

80-
#### Step 3 : [Defining Deployment Config](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment-config.html) (optional)
93+
This step ensures the specified deployment configuration exists for the application. Defining a custom configuration is *optional* because you can use the deployment strategy already defined in Code Deploy.
8194

82-
This step consists on creating a deployment config. This step is totally *optional* because you can use the deployment strategy already defined in Code Deploy.
95+
Environment Variables:
8396

84-
The following configuration allows to setup this step :
97+
* `AWS_CODE_DEPLOY_DEPLOYMENT_CONFIG_NAME` (optional): Deployment config name. By default: _CodeDeployDefault.OneAtATime_. Built-in options:
98+
* CodeDeployDefault.OneAtATime
99+
* CodeDeployDefault.AllAtOnce
100+
* `AWS_CODE_DEPLOY_MINIMUM_HEALTHY_HOSTS` (optional): The minimum number of healthy instances during deployment. By default: _type=FLEET_PERCENT,value=75_
85101

86-
* `deployment-config-name` (optional): Deployment config name. By default : _CodeDeployDefault.OneAtATime_
87-
* `minimum-healthy-hosts` (optional): The minimum number of healthy instances during deployment. By default : _type=FLEET_PERCENT,value=75_
102+
#### Step 5: [Deployment Group](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment-group.html)
88103

89-
#### Step 4 : [Defining Deployment Group](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment-group.html)
104+
This step ensures the deployment group exists within the specified application. If it does not exist, the script will attempt to create the group using the name and defined service role ARN.
90105

91-
This step consists on defining a deployment group. If the deployment group provided does not exists this step create a deployment group in Code Deploy.
106+
Environment Variables:
92107

93-
The following configuration allows to setup this step :
108+
* `AWS_CODE_DEPLOY_DEPLOYMENT_GROUP_NAME` (required): Deployment group name
109+
* `AWS_CODE_DEPLOY_SERVICE_ROLE_ARN` (required): Service role arn giving permissions to use Code Deploy when creating a deployment group
110+
* `AWS_CODE_DEPLOY_EC2_TAG_FILTERS` (optional): EC2 tags to filter on when creating a deployment group
111+
* `AWS_CODE_DEPLOY_AUTO_SCALING_GROUPS` (optional): Auto Scaling groups when creating a deployment group
94112

95-
* `deployment-group-name` (required): Deployment group name
96-
* `service-role-arn` (optional): Service role arn giving permissions to use Code Deploy when creating a deployment group
97-
* `ec2-tag-filters` (optional): EC2 tags to filter on when creating a deployment group
98-
* `auto-scaling-groups` (optional): Auto Scaling groups when creating a deployment group
113+
#### Step 6: [Compressing Source]
99114

100-
#### Step 5 : [Pushing to S3](http://docs.aws.amazon.com/cli/latest/reference/deploy/push.html)
115+
This step compresses the specified source directory as a zip file in preparation for uploading to S3. This is useful for application deployments that use unique file names per revision. This helps limit the transfer to and from S3 during deployment.
116+
117+
Environment Variables:
118+
119+
* `AWS_CODE_DEPLOY_APP_SOURCE` (required): Specifies the root source contents of the application. The `appspec.yml` should exist within this directory. If not specified, the script will use the current working directory.
120+
* `AWS_CODE_DEPLOY_S3_FILENAME` (required): The destination name within S3. Note that this should **not** include any prefix keys as these are defined elsewhere. A recommended good practice would be to use a combination of the CI build number with the git short revision. (e.g. "100#c3a5fea.zip")
121+
122+
#### Step 7: [Pushing to S3](http://docs.aws.amazon.com/cli/latest/reference/deploy/push.html)
101123

102124
This step consists to push the application to S3.
103125

104-
The following configuration allows to setup this step :
126+
Environment Variables:
127+
128+
* `AWS_CODE_DEPLOY_S3_BUCKET` (required): The name of the S3 bucket to deploy the revision
129+
* `AWS_CODE_DEPLOY_S3_KEY_PREFIX` (optional): A prefix to use for the file key. It's highly recommended to structure a bucket with a prefix per deployment group. This allows to limit stored revisions per deployment group. Note: A leading or trailing slash is not required. For example:
130+
```
131+
AWS_CODE_DEPLOY_S3_BUCKET="my-bucket-test"
132+
AWS_CODE_DEPLOY_S3_KEY_PREFIX="production-www"
133+
AWS_CODE_DEPLOY_S3_FILENAME="100#c3a5fea.zip"
134+
135+
# The resulting stored file would exist at s3://my-bucket-test/production-www/100#c3a5fea.zip
136+
```
137+
138+
#### Step 8: [Limiting Deploy Revisions per Bucket/Key]
139+
140+
This step ensures that applications with high revision/commit volume with unique filenames can remove old revisions to help limit the size of the container. Large teams can quickly fill S3 with multiple TBs/day depending on the projects. Since deployments typically don't need to store that many versions backwards, this step will ensure that only N revisions exist, removing oldest revisions upon deploy.
141+
142+
Environment Variables:
143+
144+
* `AWS_CODE_DEPLOY_S3_LIMIT_BUCKET_FILES` (optional): Number of revisions to limit. If 0, unlimited. By default: 0
145+
146+
#### Step 9: [Registering Revision](http://docs.aws.amazon.com/cli/latest/reference/deploy/register-application-revision.html)
147+
148+
This step registers a code deploy revision for the uploaded file to the specified application/deployment group.
149+
150+
Environment Variables:
151+
152+
* `AWS_CODE_DEPLOY_REVISION_DESCRIPTION` (optional): A description that is stored within AWS Code Deploy that stores information about the specific revision. Typically, the revision details would store information specific to the commit/CI/build details.
153+
154+
155+
#### Step 10: [Creating Deployment](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment.html)
105156

106-
* `s3-bucket` (required): S3 Bucket
107-
* `s3-source` (optional): S3 Source. By default : _._
108-
* `s3-key` (optional): S3 Key. By default: _{application-name}_
157+
This step deploys the application revision using the defined deployment settings across all hosts that match the deployment group.
109158

110-
#### Step 6 : [Registering Revision](http://docs.aws.amazon.com/cli/latest/reference/deploy/register-application-revision.html)
159+
Environment Variables:
111160

112-
This step consists to register the revision in Code Deploy.
161+
* `AWS_CODE_DEPLOY_DEPLOYMENT_DESCRIPTION` (optional): A description that is stored within AWS Code Deploy that stores information about the specific revision.
113162

114-
The following configuration allows to setup this step :
163+
#### [Monitor Deployment]
115164

116-
* `revision` (optional): Revision of the application to deploy. By default: _{application-name}-{application-version}.zip_
117-
* `revision-description` (optional): Description of the revision of the application to deploy
165+
This step monitors the deployment and logs information about the overall status as well as any failed instance statuses.
118166

119-
#### Step 7 : [Creating Deployment](http://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment.html)
167+
Environment Variables:
120168

121-
This final step consists to create the deployment in Code Deploy.
169+
* `AWS_CODE_DEPLOY_DEPLOYMENT_OVERVIEW` (optional): Boolean that specifies whether to log detailed information about the status of the deployment. By Default: _true_
122170

123-
The following configuration allows to setup this step :
124171

125-
* `deployment-description` (optional): Description of the deployment
126-
* `deployment-overview` (optional): Visualize the deployment. By default : _true_
127172

128173
## Example
129174

0 commit comments

Comments
 (0)