#!
bin/bash
echo
#To update & update the packages
sudo yum update -y
sudo yum upgrade -y
#To install the java for jenkins (we need jdk-11 or jdk-17 for jenkins)
sudo yum install -y java-17-amazon-corretto -y
# To install the latest jenkins version we need to add the jenkins
repository
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-
stable/jenkins.repo
#To add the gpg key
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-
2023.key
# update the packages & Install jenkins
sudo yum update -y
sudo yum install jenkins -y
#To enable the jenkins
sudo systemctl enable jenkins
#To start the jenkons service
sudo systemctl start jenkins
#To find the jenkins password for login jenkins dashbord
sudo cat /var/lib/jenkins/secrets/initialAdminPassword