Docker Build, Continuous Integration, and Deployment to Amazon EC/2 Container Service for a Node JS application
A simple Node JS application with unit tests and coverage reports using mocha and istanbul.
This repo demonstrates the following features:
- Set up serverless CI, i.e. on Shippable-provided infrastructure
- Set up CD pipelines for a Amazon EC/2 Container Service (Amazon ECS) cluster
- Perform CI tests
- Perform docker build and push image to Amazon EC/2 Container Registry (Amazon ECR)
- Automatically deploy image to TEST environment
- Manually deploy image to PROD environment
- Automatically register Amazon ECS services with application load balancer (ALB) for each environment
- Fork this repo into your source code account (e.g. GitHub)
- Create an account (or login) on Shippable with your SCM account
- Create a Amazon ECR integration on Shippable for your Google account
- Update the CI configuration in
shippable.yml
file with your integration names (see comments in file)
- Create an integration for Amazon ECS
- All pipeline config is in
shippable.resources.yml
andshippable.jobs.yml
. Check these files and update config wherever the comment asks you to replace with your specific values - Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-ecs-test' and run the job
- This demo uses a declarative job type called 'deploy' in Shippable - learn how moe about 'deploy' jobs
- Your app should be deployed to your Amazon ECS cluster labeled as your TEST environment
- Follow instructions to connect your Continuous Integration project to your Continuous Delivery pipelines(for this demo, just uncomment the
trigger
integration in shippable.yml) - Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-ecs-prod' and run the job to deploy as your PROD environment
- Make a change to your forked repo and commit to GitHub - watch your pipeline automatically execute CI with push to Amazon ECR and automatic deployment to the TEST environment in Amazon ECS
- Then right-click to deploy the newest changes to the PROD environment
Your end-to-end pipeline is complete! Now, any change you make to the application will be deployed to your Amazon ECS TEST environment and be ready to manually deploy to your PROD environment, as well.
See the Amazon ECS documentation to set up an Amazon ECS cluster