DevOps Team Lead in Content
The first step in using Jenkins as part of a continuous integration pipeline is to install it. This activity will guide you through the steps required to install Jenkins in a Linux environment. After completing this exercise, you will know how to install Jenkins and be ready to begin using it for continuous integration.
You have been asked to install and configure a Jenkins server so that your team can use it in order to do continuous integration.
In order to accomplish this, you will need to:
- Install Java JDK 8 or later
- Configure the Jenkins YUM repository
- Install Jenkins from the YUM repository
- Enable and start the Jenkins service
- Get the temporary admin password and use it to log in to Jenkins
- Install the default plugins
- Create a permanent administrator account
Some useful links:
- Installing Jenkins on RedHat distributions: https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions
- Jenkins installation documentation for other environments: https://jenkins.io/doc/book/installing/
Begin by logging in to the lab server using the credentials provided on the hands-on lab page:
Install and Run Jenkins
Install Java and the
sudo yum -y install java-1.8.0-openjdk epel-release
Configure the Jenkins YUM repository
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
Install the Jenkins key.
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install jenkins-2.121.1
sudo systemctl enable jenkins
sudo systemctl start jenkins
Create an Administrator Account
In a browser, navigate to the Jenkins IP address.
On the server, find the temporary password.
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the temporary password.
In the browser, paste in the temporary admin password into the box provided.
Click Install suggested plugins.
Enter details for an "admin" user.
Click Save and Finish.
Click Start using Jenkins.
Congratulations — you've completed this hands-on lab!