This is the demo for the 'Turbocharge Your Continuous Deployment Pipeline with Containers' re:Invent session.
- Make sure you followed the ECS getting started steps before continuing.
- For this demo we'll be using the us-east-1 region.
-
Create two ECS clusters: staging and production.
-
Launch Container instances in both clusters using the latest ECS Optimized AMI (amzn-ami-2015.03.g-amazon-ecs-optimized as of Sept 14th). Specify a Security Group that allows access to ports TCP/80, TCP/8080 and TCP/22. Make sure you specify the ECS cluster to join in the user data section:
#!/bin/bash # Join the ECS Cluster echo ECS_CLUSTER=<CLUSTER_NAME> >> /etc/ecs/ecs.config
-
Launch an EC2 instance, connect to it and install Jenkins.
-
Install and configure the Cloudbees ECS Plugin. Create a build job for the Photogram demo app. Restrict execution of the job to the ECS Slaves.
-
Add a new Freestyle project job (e.g. photogram). Select the Restrict where this project can be run and add the label used when configuring the Cloudbees ECS Plugin (e.g. ECS_Slave). Configure the Github repository (e.g. https://github.com/awslabs/dvo305-demo) and select the Build when a change is pushed to GitHub option. Add a Invoke Rake step to execute the Spec tests.
-
Create a PostgreSQL RDS instance, allowing access to it from the ECS instances' Security Group. Once the instance is ready, update the database-related environment variables in
docker-compose.yml
. Note that these database variables will be set automatically by Elastic Beanstalk if running on Elastic Beanstalk using a Beanstalk-managed RDS instance. -
Create a Multicontainer Docker Elastic Beanstalk Application.
-
Create a Pipeline that gets the sources from Github and deploys to Elastic Beanstalk.
-
Start the app on your local environment
docker-compose up
- Show app up and running
- Introduce small change
- Re-start app and show change
- Show Jenkins and CodePipeline setup
- Show how images are built
- Show prod app (still old version)
- Push changes
- Wait for deployment, show new version