Pre-Requirement:
Update repo details
sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Please Follow below instructions to install and configure CentOS 8:
1) Install epel-release.
sudo yum install epel-release -y
2) Install open-jdk
sudo yum install java-11-openjdk -y
3) Configure Jenkins repo.
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
4) Add Jenkins key.
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
5) Install Jenkins.
sudo yum install jenkins -y6) Once Installation of Jenkins installation is completed start jenkins service.
sudo systemctl start jenkins
7) Enable Jenkins service to be restart on system reboot
sudo systemctl enable jenkins
8) By Default Jenkins will run and accessible over 8080 port. We need to open port to access in our browser if we are using Jenkins on Virtual Environment.
i) If you are using Vagrant please add below line to Vagrantfile and restart vm.
config.vm.network "forwarded_port", guest: 8080, host: 8080
ii) If you are using Oracle VirtualBox please follow below steps to open 8080 port
Right Click on VM and go to settings.
Click on Port Forwarding button and add a new port mapping as mentioned in below screen.
9) Once you finished above step you should able to access Jenkins on your favorite browser.
10) You need to copy the password from /var/lib/jenkins/secrets/initialAdminPassword to text box and click on continue.
11) Click on Suggested Plugin Installation. This will install all required plugins to start with CI & CD pipeline.