Skip to content

Latest commit

 

History

History
96 lines (49 loc) · 4.65 KB

File metadata and controls

96 lines (49 loc) · 4.65 KB

AWS CodeDeploy Setup Guideline

Installation Steps

  1. Log into AWS.

  2. Search for the CodeDeploy service and select it.

CodeDeploy Setup 1

  1. In the Applications pane, click on Create application.

CodeDeploy Setup 2

  1. On the Create application pane, enter the name for your application and select EC2/On-premises option as Compute platform and then click on Create application.

CodeDeploy Setup 3

  1. You should see a confirmation message and the configuration entered in Application details section. Now a deployment group need to be created, click on Create deployment group button.

CodeDeploy Setup 4

  1. Create deployment group. Enter a name for the Deployment Group and choose the service role with CodeDeploy permissions created previously. If not, create one following the instructions in the link Creating a Service Role for AWS CodeDeploy. After that you can continue creating the deployment group.

CodeDeploy Setup 4

  • Since we are going to work on the same instance we need to choose In-place as Deployment type. Select Amazon EC2 instances for your Environment configuration you need to have your EC2 instance tagged.

CodeDeploy Setup 4

  • In Deployment settings choose CodeDeployDefault.AllAtOnce as you Deployment configuration. Uncheck Enable load balancing option in Load balancer pane as we are not using any load balancing configuration. Leave Advanced options As-Is, then click Create deployment group.

CodeDeploy Setup 4

  • You should see a confirmation message and the details for the Deployment group just created. Click Create deployment.

CodeDeploy Setup 4

  1. Create a Deployment. Now that we have the application and a group configured we are ready to create our deployment. Verify you have the correct Deployment group selected then choose My application is stored in GitHub option as Revision type. Then you need to enter the GitHub account where is the application you are going to deploy. To connect to a GitHub account for the first time, type an alias for the account, and then choose Connect to GitHub.
Go to your GitHub account and get the **Full Path name** and **Commit ID** you want to deploy.
  • Repository Full name.

CodeDeploy Setup 4

  • Click on "commits".

CodeDeploy Setup 4

  • Copy the Commit ID by clicking on the icon Github copy icon.

CodeDeploy Setup 4

  • At the en your screen on AWS Deployment settings should look like this.

CodeDeploy Setup 4

  • Check option "Don't fail the deployment to an instance if this lifecycle event on the instance fails", and choose "Overwrite the content" option.

CodeDeploy Setup 4

  • Leave "Disable rollback" option unchecked.
  1. Finally, click Create deployment and you will see a confirmation message.

CodeDeploy Setup 4

  • If process run successfully you should see a page like this.

CodeDeploy Setup 4

  • Now you can navigate to your instance url and verify that your application was deployed correctly.

CodeDeploy Setup 4

Troubleshooting

During Deployment things could go wrong, fortunately AWS gives pretty good hints about the possible error causes.

  1. After a failed Deployment you can check the events by clicking on View events link on Deployment lifecycle events section.

CodeDeploy Setup 4

  1. Event list will show you the source of the error. For this particular example we can see that an error occurred during the package Installation. The next step is click on the UnknownError link to view the detail of this error.

CodeDeploy Setup 4

  1. Event Details Message describes the cause of the error.

CodeDeploy Setup 4

The most common causes of error during a Deployment process are:

  • Troubles finding the built artifact or war file to deploy. Mostly because in our GitHub repositories we don't push targets directories with war files.
  • Missing Permissions on AWS Service Roles, remember that at least a CodeDeploy Service Role needs to be configured.