This project shows an example of continuous deployment with GitHub, Travis CI, Amazon EC2 Container Service (ECS) and Docker.
The idea is to deploy a simple NodeJS application in Amazon ECS. When we push updates to GitHub, Travis CI will run the tests. Then, it will create and push a Docker instance to Amazon EC2 Container Register (ECR). After that, the Amazon service is updated and we will have a new version of our NodeJS application up and running.
- GitHub
- Docker
- Amazon EC2 Container Service, also known as ECS
- Amazon EC2 Container Register, also known as ECR
- Travis CI
- NodeJS
First, I suggest you to create an user for Travis (named Travis CI, for example) and to include only the policies required to access the services you want. As we will use Travis to push the docker instance to ECR, I added the "AmazonEC2ContainerRegistryFullAccess" policy to Travis CI user.
After that, go to Travis CI and open the project settings to update the environment variables. Create the AWS_ACCESS_KEY_ID and the AWS_SECURITY_ACCESS_KEY using the values that you received when you created the Travis user.