When using AWS, it seems a nice way to deploy an application to a newly created instance is via AWS CodeDeploy. This works as follows:
- Set up an auto-scaling group for the application
- Write a user-data bash script for the auto-scaling group which pulls the CodeDeploy agent from S3, installs it and starts it
- Set up a CodeDeploy deployment group which deploys to the auto-scaling group
Now, when an application bundle (e.g. jar or debian package) is deployed to the deployment group, it will be deployed automatically to new instances launched in the auto-scaling group.
My question is: how can this deployment strategy fit with a CI tool like Travis CI?
Specifically:
- How can CodeDeploy pick up a package built by a CI tool like Travis CI? Does the build job need to upload the package to S3?
- How can CodeDeploy be used to deploy the application gradually (e.g. one instance at a time)?
- Does this deployment strategy require each running instance to be shut down and replaced, or is the new version of the application deployed on the existing instances? If it is the former, machine IP addresses would change during deployment, so how can other services discover the newly deployed application (i.e. without hardcoded IP addresses)?