We have worked with several clients, to come up with Code Deployment solutions.
In some cases, the solutions is small, on a simple website redesign where the client simply wants to have the revisions history that comes with a Code repository such as GIT or Subversion (SVN).
However in more robust environments, where the client needs to have separate development, test and productions servers (dev, test and live), we often end up building a more involved software development lifecycle (SDLC).
One of the Software Development Life Cycles we use makes use of the AWS platform and the Code Deployment tools. This article is to describe a little bit about how we have used the code deployment tools, and to give Round Up all of the articles we have written as of 2/26/2016 about solving issues with AWS Code Deploy.
CodeDeploy on AWS is a tool which automatically connects to a group of EC2 servers, to deploy code and runs scripts. This automates the labor intensive task of connecting to and consistently updating several each time that a new version of a new website design or development.
The concept behind the way we have used it is. Setup a CodeDeployment group and associate it with an AutoScaling group. When your group grows, the code is deployed to it, When your code is deployed all members of the group receive it.
- make your source code changes in your development environment
- zip up your source code and upload it to an S3 bucket
- create a new revision within your deployment group and start the deployment
The AWS system will, over the course of 1 to 30 minutes, go through each of your servers (depeing on your deployment configuration, I always use OneAtATime)
The following Roundup, lists each of the articles matraex has written about the AWS Code Deployment
Challenges when working with CodeDeploy and an AWS AutoScaling Group
I write about how in one setup I used a GIT repo to store my code, then I write some automated scripts (deploy.php) to check in the code, and deploy it to a test environment, and then to deploy the code to live (each has their own separate group).
In this AWS Auto Scaling Group – CodeDeploy Challenges article
- about how errors in the codedeploy-agent are hard to debug
- if a server is terminating while you deploy, the deployment could fail
- in an update, I describe a script command that can be run to clean up the install to prevent some deployment failure
I write about some of the difficulties of understanding what is happening during a code deployment and how to debug it.
The quick of it is to update ‘/etc/codedeploy-agent/conf/codedeployagent.yml’ to have ‘verbose=true’ and restart the codedeployagent and then read the ‘/var/log/aws/codedeploy-agent/codedeployment-agent.log’ file to figure out what happened.
Read the entire article Debugging CodeDeployment on AWS here for more of a description with the actual commands highlighted and for a couple error examples