Capstone project for Udacity Dev-Ops Nanodegree: develop a CI/CD pipeline for micro services applications with either blue/green deployment or rolling deployment.
The CI CD pipeline is as follows for this project. For initial set up:
- Set up jenkins
- Install dependencies for local development
- Create AWS infrastructure
For application development:
- Make development change
- Commit to git
- Update AWS stack using
./awsCoUp.sh
commands listed below if required - Push to repository
- Jenkins build automatically runs based on triggers
- Files are linted
- Docker image build and uploaded to ECR
- ECS tasks updated to run new Docker image using rolling deployment
There is a Makefile
that contains lots of useful commands.
Running make
will list them, like the below output.
help: Show this help.
setup: Create the virtial environment to run this project
env: List the environment versions
lint: Check the validity of the project files
test: Run the tests for this prject
install: Install the required imports for this project
docker-build: Build the docker image and list available docker images
docker-upload: Upload the docker image to AWS
start-api: Run the python application locally
From the base of this repository run the following to create or update the deployment.
aws configure # set to credentials with appropriate access
cd scripts; ./awsCoUp.sh network ../cloudformation/01-network.yml ../cloudformation/01-network-parameters.json; cd ..
# Wait for the network stack to be complete
cd scripts; ./awsCoUp.sh cluster ../cloudformation/02-cluster.yml ../cloudformation/02-cluster-parameters.json; cd ..
Full jenkins set up details can be found in jenkinsSetup.md
.
From running the above the following will be created.
The application is currently running here is a link to the load balancer.
AWS Stacks:
Jenkins build when the lint fails:
Jenkins build when the lint passes and deploys to ECR:
Hello world application running:
GitHub