Installing Jenkins for CentOS 6.5
1. Introduction
This post shows how to install Jenkins for CentOS 6.5
2. Step by Step
2.1. Check/Install JDK or JRE
Check if JDK 1.6 or greather is available on machine. Depending on the purpouse of your Jenkins instalation, you will need to instal JDK (I strongly recommend). If you just want to take a look in Jenkins, so you can install JRE.# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
# echo "Execute following command if JRE is not installed ..."
# yum install java
:
:
#
# echo "I decided to install more than a simple JRE because I will compile code"
I decided to install more than a simple JRE because I will compile code
# yum install java-1.7.0-openjdk-devel
:
:
2.2. Add Jenkins repository to machine
# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo# sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
# sudo yum install jenkins
2.3. Install Jenkins
# yum install jenkins:
Dependencies Resolved
===========================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================
Installing:
jenkins noarch 2.3-1.1 jenkins 63 M
Transaction Summary
===========================================================================================================================
Install 1 Package(s)
Total size: 63 M
Installed size: 64 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : jenkins-2.3-1.1.noarch 1/1
Verifying : jenkins-2.3-1.1.noarch 1/1
Installed:
jenkins.noarch 0:2.3-1.1
Complete!
:
2.4. Add Jenkins to system boot
# chkconfig jenkins on
2.5. Start Jenkins service
# service jenkins startStarting Jenkins [ OK ]
# service jenkins status
jenkins (pid 1310) is running...
2.6. Check Jenkins services
a. Checking Port Service
# echo "Jenkins default port is 8080. Check port listening ..."# netstat -tnlp | grep 8080
b. Checking firewall rules
# echo "Check if port 8080 is listening ..."# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:10050
: : : : : :
# echo "Add listening rule to 8080 - Save rules - restart services ..."
# iptables -I INPUT 2 -p tcp --dport 8080 -j ACCEPT
# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
# service iptables restart
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080
2.7. Configure Jenkins administrator password
- Open first time your Jenkins server on browser
- http://127.0.0.1:8080/
Getting Started
Unlock Jenkins
To ensure Jenkins is securely set up by the administrator, a password ....
/var/lib/jenkins/secrets/initialAdminPassword
Please copy the password from either location and paste it below.
# cat /var/lib/jenkins/secrets/initialAdminPassword
2.8. Configure Jenkins - Installing Plugins recommended
Getting StartedCustomize Jenkins
Plugins extend Jenkins with additional features to support many different needs.
Install suggested plugins
2.9. Configure Jenkins - Configure first admin user
Getting StartedCreate First Admin User
username: admin
password: admin
e-mail : admin@yourdomain.com
2.10. Configure Jenkins - Jenkins is ready
Getting StartedJenkins is ready!
Nenhum comentário:
Postar um comentário