Configure EC2 instance to setup the CI pipeline
#!/bin/bash
sudo apt update
#Install JDK
sudo apt install openjdk-17-jre -y
#Install Jenkins
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
# Install Docker
sudo apt install docker.io -y
# Grant Jenkins and Ubuntu user permission to access Docker daemon
sudo usermod -aG docker jenkins
sudo usermod -aG docker ubuntu
sudo systemctl restart docker

Create a Security Group and allow the below ports under Inbound rules
Type
Port
Used For


Last updated