Method of installing Jenkins on CentOS
- 2020-05-30 21:43:23
- OfStack
Jenkins
Is open source, USES
Java
Written continuous integration tool, available on Centos
yum
Install directly from the command line. Record the installation process so you can look it up later. Need to be installed first
Java
, if already
Java
You can skip this step.
Install Java
See the current system
Java
Version of command:
java -version
If the display
Java
The version number indicates that it has been installed correctly. If the command is not displayed, Java needs to be installed:
sudo yum install java
The command if detected
Java
There is no direct installation
Java
Can be upgraded if it already exists
Java
.
Install Jenkins
The first thing to do is add
Jenkins
Source:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
Use directly after the addition is complete
yum
Command to install
Jenkins
:
yum install jenkins
Start the Jenkins
Start with a command
Jenkins
:
sudo service jenkins start
Starting Jenkins [ OK ]
Enter: http:// in the browser
<
Server ip
>
:8080/ you can enter
Jenkins
The interface is used directly.
stop
Jenkins
The command of the service is:
sudo service jenkins stop
The related configuration
Jenkins
Installation directory:
/var/lib/jenkins/
Jenkins
Profile address:
/etc/sysconfig/jenkins
This is the
Jenkins
The configuration file can be viewed here
Jenkins
The default configuration.
yum
0
Here are three important configurations:
JENKINS_HOME JENKINS_USER JENKINS_PORT
yum
1
It's the home directory of Jenkins, where Jenkins works, where Jenkins stores files, where Jenkins's plugins are, and where Jenkins generates files.
## Path: Development/Jenkins
## Description: Jenkins Continuous Integration Server
## Type: string
## Default: "/var/lib/jenkins"
## ServiceRestart: jenkins
#
# Directory where Jenkins store its configuration and working
# files (checkouts, build reports, artifacts, ...).
#
JENKINS_HOME="/var/lib/jenkins"
JENKINS_USER
Is a user of Jenkins with permissions of $JENKINS_HOME and /var/log/jenkins.
## Type: string
## Default: "jenkins"
## ServiceRestart: jenkins
#
# Unix user account that runs the Jenkins daemon
# Be careful when you change this, as you need to update
# permissions of $JENKINS_HOME and /var/log/jenkins.
#
JENKINS_USER="jenkins"
JENKINS_PORT is the port of Jenkins, and the default port is 8080.
sudo yum install java
0