forked from ashishrpandey/devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetting-up-Jenkins
More file actions
47 lines (40 loc) · 2.05 KB
/
Copy pathSetting-up-Jenkins
File metadata and controls
47 lines (40 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
General procedure to install Jenkins:
$java -version ## Check if Java is already installed
For jenkins Java 8 is required.
Download Jenkins from www.jenkins.io/download for your platform
Install Jenkin
Launch Jenkin
It shall open in web-browser at localhost:8080
Enter initial passowrd on the first page.
Change admin password
Your Jenkin Dashboard is ready
Explore it !!!
############## Step-by-step installation of Jenkins on ec2 instances ################
yum update -y
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo ## Add jenkins in yum repo
rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key ##download the key necessary for proper installation
yum install jenkins ## install Jenkins
service jenkins start ## Start Jenkins
chkconfig jenkins on ## Check if Jenkins is working
cat /var/lib/jenkins/secrets/initialAdminPassword ## Get the initial admin password gor first login
##use the content of file for initial admin password
Edit security group inbound rules
Add rules for:
http at port number 80
and "custom tcp rule" at port number 8080
open : <public ip>:8080 ## e.g 172.13.0.2:8080
We will get jenkins dashboard:
Login as admin with the above-said password.
Change password.
Create new user. ##optional
********************* Connecting it with github *********************
To trigger builds every time some code is checked-in to the git, follow below steps:
At Jenkins:
In configuration of the project at jenkins under "build trigger" section select "GitHub hook trigger for GITScm polling"
At github sever:
Open your github account --> select the project repository -- > opent setting page of the repo --> select web-hooks tab
--> add webhook --> enter in Payload URL folowing URL: http://<Name of Jenkins server>:8080/github-webhook/
--> select "just the push event"
**********************Setup maven tool *******************
manage jenkins---> configure global tools --> add Java jdk--> add maven home --> add git --> IN the build step write
clean package