- Maven
- Git Hub
- Jenkins
- Docker
- Create Ubuntu VM using AWS EC2 (t2.medium) with atleast 50 GB storage
- Enable 8080 Port Number in Security Group Inbound Rules
- Connect to VM using MobaXterm
- Install Java
sudo apt update
sudo apt install fontconfig openjdk-17-jre
java -version
- Install Jenkins
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
- Start Jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
- Verify Jenkins
sudo systemctl status jenkins
NOTE: below are few additional commands for understanding purpose
To stop, restart, disable/enable jenkins on system start-up
sudo systemctl stop jenkins
sudo systemctl restart jenkins
sudo systemctl disable jenkins
sudo systemctl enable jenkins
- Access jenkins server in browser using VM public ip
http://public-ip:8080/
- Copy jenkins admin pwd
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- Create Admin Account & Install Required Plugins in Jenkins
- Manage Jenkins -> Tools -> Maven Installation -> Add maven
curl -fsSL get.docker.com | /bin/bash
sudo usermod -aG docker jenkins
sudo usermod -aG docker ubuntu
sudo systemctl restart jenkins
sudo docker version
- Stage-1 : Clone Git Repo
- Stage-2 : Maven Build
- Stage-3 : Create Docker Image
- Stage-4 : Create Docker Container
- We should be able to access our application
URL : http://public-ip:port/