Jenkins on RHEL

Installation of Jenkins on RHEL
##########################

Getting the repo
#######################
[root@dhcppc5 ~]# wget -O /etc/yum.repos.d/jenkins.repo 

Importing Key
####################################
[root@dhcppc5 ~]# rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

Install package
#################
[root@dhcppc5 ~]# yum install jenkins -y

Check the version
#########################
[root@dhcppc5 ~]# rpm -q jenkins
jenkins-2.108-1.1.noarch

Install Java
##########################
[root@dhcppc5 ~]# yum install java -y

Check the status of Firewall
#########################
[root@dhcppc5 ~]# systemctl status firewalld

If firewalld is running either stop the firewall or add rules to the firewall
########################################################

Stop and disable firewall
############################
[root@dhcppc5 ~]# systemctl stop firewalld && systemctl disable firewalld
Adding rules to the firewall
###########################
[root@dhcppc5 ~]# firewall-cmd --permanent --new-service=jenkins
success
[root@dhcppc5 ~]# firewall-cmd --permanent --add-service=jenkins
success

Reload the firewall after adding rules
################################
[root@dhcppc5 ~]# firewall-cmd --reload
success

Check the list of Firewall
#########################
[root@dhcppc5 ~]# firewall-cmd --list-all

Start and enable jenkins service
############################
[root@dhcppc5 ~]# systemctl restart jenkins && systemctl enable jenkins

Check the status of jenkins service
#################################
[root@dhcppc5 ~]# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
  Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
  Active: active (running) since Fri 2018-02-23 10:23:32 IST; 35s ago
    Docs: man:systemd-sysv-generator(8)
 Process: 25923 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
  CGroup: /system.slice/jenkins.service
          └─25948 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/va...

Feb 23 10:23:27 dhcppc5 systemd[1]: Starting LSB: Jenkins Automation Server...
Feb 23 10:23:27 dhcppc5 runuser[25928]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Feb 23 10:23:32 dhcppc5 jenkins[25923]: Starting Jenkins [  OK ]
Feb 23 10:23:32 dhcppc5 systemd[1]: Started LSB: Jenkins Automation Server.

Check the ports and service
###########################
[root@dhcppc5 ~]# netstat -tnlp

Open localhost.localdomain:8080 in your browser, it will ask to unlock the jenkins

For unlock jenkins use password
################################
[root@dhcppc5 ~]# cat /var/lib/jenkins/secrets/initialAdminPassword
ac5f882f7b204564aebd53a5972dbe3e

Then click on install suggested plugins

Comments

Popular posts from this blog

DevOps Interview Questions

Calico Certified Operator: AWS Expert Questions & Answers

CKAD Certification Exam Preparation Guide and Tips