2018.08.08 14:42:26 Word count 381 Reading 1022
Disclaimer: This article is just a test plug-in, no script attachment, can be used as a reference
1. Configure and install Jenkins
Go to the jenkins official website https://jenkins.io/index.html to download the jenkins installation package
There are two types of jenkins installation packages, one is LTS and the other is Weekly. LTS is a stable version, Weekly will be updated once a week, currently I choose LTS
Download the rpm package and install the Jenkins rpm package
rpm -ivh jenkins-2.107.3-1.1.noarch.rpm
(1) View the location of the Jenkins installation package
rpm -ql jenkins
(2) Add my jdk directory to the following files
vim /etc/init.d/jenkins
Add the corresponding jdk directory statement, among which the red statement needs to be added
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/bin/java
/usr/local/jdk/jdk1.8.0_161/bin/java
(3) Modify Jenkins port
vim/etc/sysconfig/jenkins
JENKINS_PORT="8888"
(4) Open the firewall of port 8888
firewall-cmd --zone=public --add-port=8888/tcp --permanent
firewall-cmd --reload
(5) Start Jenkins
service jenkins start
Shut down Jenkins
service jenkins stop
Restart Jenkins
service jenkins restart
Note: Encountered the following error during startup:
Starting jenkins (via systemctl): Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.
solution
systemctl daemon-reload
(6) Type ip+port in the browser to open the Jenkins webpage, and the following picture appears
http://ip:8888
(7) Obtain the local administrator password
cat /var/lib/jenkins/secrets/initialAdminPassword
Choose to install recommended plugins
2. Build the project
New task-build a free style software project
( adsbygoogle = window.adsbygoogle || []).push({});
Recommended Posts