This repository contains a demo project created as part of my DevOps studies in the TechWorld with Nana – DevOps Bootcamp.
https://www.techworld-with-nana.com/devops-bootcamp
Demo Project: Complete the CI/CD Pipeline (Docker-Compose, Dynamic versioning) Technologies used: AWS, Jenkins, Docker, Linux, Git, Java, Maven, Docker Hub
Project Description:
- CI step: Increment version
- CI step: Build artifact for Java Maven application
- CI step: Build and push Docker image to Docker Hub
- CD step: Deploy new application version with Docker Compose
- CD step: Commit the version update
Complete the previous demo project first. The EC2 instance must be launched with Docker installed. See aws-module-9.1 for setup instructions.
Authenticate with Docker Hub before proceeding:
docker login
Reference: https://gist.github.com/npearce/6f3c7826c7499587f00957fee62f8ee9
Download the binary:
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-composeFix permissions:
sudo chmod +x /usr/local/bin/docker-composeVerify installation:
docker-compose versionSee ./app/docker-compose.yaml for the configuration that deploys the web application image.
Groovy: app/script.groovy
Jenkinsfile: Jenkinsfile
- Go to Dashboard → New Item
- Name it
aws-multibranch, select Multibranch Pipeline, click OK
Click Add source → Git and configure:
| Field | Value |
|---|---|
| Credentials | github |
| Repository HTTPS URL | https://github.com/explicit-logic/aws-module-9.4 |
Click Validate to confirm access.
Click Add and include:
Discover branchesDiscover pull requests from origin
| Field | Value |
|---|---|
| Script Path | Jenkinsfile |
Click Save — Jenkins will scan the repository and automatically create jobs for each branch.
-
Navigate to the
aws-multibranchpipeline → Credentials → Add Credentials -
Fill in the following fields:
| Field | Value |
|---|---|
| Kind | SSH Username with private key |
| ID | aws-ec2 |
| Username | ec2-user |
| Private Key | Paste the contents of your .pem file |
To copy the private key content:
cat ~/.ssh/app-key.pem