Sunday, May 15, 2016

Jenkins Installation

Check if anything is running on the port 8080 which is used by the jenkins by default
 telnet localhost 8080  

Install the Java JDK which is required by the Jenkins
 mkdir /usr/java  
 cd /usr/java
 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz
 tar -xf jdk-8u92-linux-x64.tar.gz
 cd jdk1.8.0_92/
 update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_92/bin/java 100
 update-alternatives --config java
 update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_92/bin/javac 100
 update-alternatives --config javac
 update-alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0_92/bin/jar 100
 update-alternatives --config jar

Setup the JAVA_HOME
 vi /etc/rc.d/rc.local  
 export JAVA_HOME=/usr/java/jdk1.8.0_92/      
  export JRE_HOME=/usr/java/jdk1.8.0._92/jre      
 export PATH=$PATH:/usr/java/jdk1.8.0_92/bin:/opt/java/jdk1.8.0_92/jre/bin

Import the Jenkins repo
 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo  

Import the keys for the repo
 sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key  

Enable the jenkins service to start at runtime
 /bin/systemctl enable jenkins.service  
 /bin/systemctl restart jenkins.service

This completes the installation of the jenkins. You can access the web-console by entering your ip followed by port 8080

You would need to copy the password from the location "/var/lib/jenkins/secrets/initialAdminPassword" and paste in the console as a step in the new installation.
 cat /var/lib/jenkins/secrets/initialAdminPassword  

Next select the default plugins to be installed. this will install some the most commonly used plugins alternatively you can select the plugins which should be installed.

Create the Admin Username and password which would used for the authentication purpose everytime you login to jenkins.

This completes the Jenkins Installation.


Post a Comment