1. The background

2. Installation process

2.1 Install the JDK first

Yum -y install Java -- 1.8.0 comes with its *Copy the code

2.1 installation Jenkins

Follow this article: pkg.jenkins. IO/Redhat-stab…

Install wget

yum install wget
Copy the code

Import the key

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
  sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Copy the code

Start installing Jenkins

yum install jenkins
Copy the code

The Jenkins installation is complete.

3. Setup wizard

3.1 start Jenkins

systemctl  start  jenkins
Copy the code

Then open the web site: http://192.168.134.215:8080/ you can access.

Now also pay attention to the firewall Settings.

3.2 Firewall Enable port 8080 and restart the firewall

firewall-cmd  --add-port=8080/tcp  --permanent
firewall-cmd --reload
Copy the code

3.3 Configuration before Startup

Refer to www.jenkins.io/zh/doc/book… Perform pre-startup configuration

4. Problems encountered

Jenkins remote execution shell appearscommand not found

  • Jenkins: Java: Command not found;
  • This error occurs because environment variables are not automatically loaded when shell scripts are executed remotely.
  • Source /etc/profile;

The sample

source /etc/profile

cd /root/shell
sh erp-shop-h5-server.sh
Copy the code

Reference 5.

www.jenkins.io/zh/doc/book… Blog.csdn.net/gexiaoyizhi… www.cnblogs.com/mmzs/p/1209… Blog.csdn.net/f820306455/… www.cnblogs.com/phpshen/p/5…