Install jenkins in centos7

1.sudo yum install -y epel-release
sudo yum -y update
sudo yum install -y net-tools
sudo yum install -y wget
2.sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm –import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install -y jenkins
sudo yum install -y java-1.8
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64/
export PATH=$PATH:$JAVA_HOME
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service

3. Login to jenkins console

x.x.x.x:8080

username : admin

password should be copied from sudo cat /var/lib/jenkins/secrets/initialAdminPassword

4. Skip plugin installation page

5. To change admin password

admin >> configurate >> Password

6. Configure java path under jenkins configuration

Manage Jenkins >> Global Tool Configration >> JDK

We have already set JAVA_HOME path in step2

You can also find JAVA_HOME path using

$ sudo find / -name javac

7. To run a Test Job

1 Create “new item”

2 Enter an item name test

choose Freestyle project

3 Under option Build section

Execute shell : echo “test project”

4 Apply and Save

5 Build Job

6 Check Console Output

Leave a comment