Jenkins Installation Steps
Jenkins Installation Steps
http://54.243.5.107:8080/
you can see the jenkins page
install
● cd /opt/
● wget --no-cookies --no-check-certificate --header "Cookie:
gpw_e24=http%3A%2F%2Fwww.oracle.com%2F;
oraclelicense=accept-securebackup-cookie"
"http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad
6ed6d1/jdk-8u181-linux-x64.tar.gz"
● tar xzf jdk-8u181-linux-x64.tar.gz
● cd /opt/jdk1.8.0_181/
cd sr/bin/java java /opt/jdk1.8.0_181/bin/java 2
● alternatives --config java
● vi ~/.bash_profile
● source ~/.bash_profile
● service jenkins start
● yum install git -y
● cd /opt
● wget
http://mirrors.fibergrid.in/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin
.zip
● unzip apache-maven-3.5.4-bin.zip
● cd apache-maven-3.5.4
● pwd
● vi ~/.bash_profile
● source ~/.bash_profile
● mvn
● cd /opt/
● wget
http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.33/bin/apache-tomcat-8.5.33.zip
● unzip apache-tomcat-8.5.33.zip
● cd apache-tomcat-8.5.33/
● ls -lrt
● cd conf
● ls -lrt
● cd bin
● ./startup.sh
● netstat -an | grep 8080
● vi context.xml
● vi tomcat-users.xml
● vi server.xml
==============================================================
To check the Jenkins server running or not
Exercise1:
save
It will fail even we use sudo command, because, all process running by jenkins user
#includedir /etc/sudoers.d
ec2-user ALL=(ALL) NOPASSWD: ALL
jenkins ALL=(ALL) NOPASSWD: ALL
[root@ip-172-31-86-155 opt]#
browse the url with public ip and will get http appache test page
Exersie:2
Now, we will try to do activity remote ssh execution or executing commands on remote
machine.
step2: install ssh plugins in jenkins server, show that it can talk with remote
machine
In place of private key box, provide.pem file content and past in that box.
Step:3
Click on check connection, you will gett connection was successfull if you provide
proper details.
Step4:
To Verufy, browse url with remote machine public ip. It will disply hhtp appache page
Step5:
Now, try to create index file in remote machine location with some content
Save and Build it again. It should be successful. Browse the url and check it out
Jenkins
create new node---> provide node name and select option Permanent
Provide the details properly
jenkins--> New Item-->Free style job--> provide name "slavejob1" and click on ok
save and Build it after writing script on build page
2 ways
Exercise1:
go to each configure and Configure each job should trigger one after another job
Exercise:
Github webhooking:
Login into github with your login credentials
Create one repo as demo_repo1
create one file as file2in above repo and commit it
step1: Go to repo on your github--> settings(top
right)-->webhooks(left side)-->addwebhook-->provide
jenkins server url and select application/json, select
everything option
Step2:
step3:
Now, change the gothub repo file . Once you modify the file, build will trigger automatically on
jenkins.
adding remote host and executing commands on remote machine
step1: install ssh plugin which will give capability of running commands on remote ssh servers.