jenkins installation
foreword
You must install jdk before installing jenkins. The latest version of jenkins requires jdk11 or above. Here I install jenkins-2.346+jdk8 (jdk1.8), install git and maven at the same time, and configure it for later use.
The following figure is the matching figure of each jenkins version and the required jdk version
1. jdk installation
-Refer to this link article to install jdk8 (jdk1.8)
JDK installation: https://blog.csdn.net/dontYouWorry/article/details/128919926
Two, maven installation
- Refer to this link article to install maven
maven installation: https://blog.csdn.net/dontYouWorry/article/details/128934720
Three, git installation
1. Install git
yum -y install git
2. View version
git --version
Fourth, jenkins installation
1. Download the jenkins-rpm package
wget https://repo.huaweicloud.com/jenkins/redhat-stable/jenkins-2.346.3-1.1.noarch.rpm
2. Install
rpm -ivh jenkins-2.346.3-1.1.noarch.rpm
3. Modify the jenkins configuration - add your own jdk path - - If you do not modify the java path, it will fail to start
vim /etc/init.d/jenkins
4. Modify the jenkins user permission to root
#将JENKINS_USER="jenkins 改为 JENKINS_USER="root"
vim /etc/sysconfig/jenkins
5. Start the jenkins service
#在 /etc/init.d/ 执行
./jenkins start #启动服务
#其他指令
./jenkins stop #关闭服务
./jenkins restart #重启服务
6. Browser access login - - - (http://IP:8080/) Pay attention to the open port
of the firewall before connecting8080
#防火墙开放8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
systemctl restart firewalld #重启
View default login password
cat /var/lib/jenkins/secrets/initialAdminPassword
There is no need to download plug-ins, because many plug-ins are downloaded too slowly, and it is easy to waste time on download failures. You can download the required plug-ins in a targeted manner later
1. Set Chinese display
1. Download the plugin
Click Dashboard>Manage Jenkins> Plugin Manager
to download
Localization: Chinese (Simplified)
Locale
2. First set the language to English display
3. Restart jenkins
#在 /etc/init.d/ 执行
./jenkins restart
4. Reset the language to Chinese display, 保存
just click
5. If Chinese is not complete, half Chinese and half English, first set the default language to English, restart Jenkins and then set it to Chinese, that is, repeat steps 2 - 4
*注意:
Jenkins may still have incomplete Chinese after an accident or manual restart, continue 步骤2-4
can
2. Plug-in download
Deploy to container
(Supports automatic code deployment to tomcat container)
Maven Integration
(jenkins uses maven to compile, package, required plug-ins)
Node.js
(packages vue
required plug-ins for front-end projects)
Git
(git plug-in, pull code from hosting platform)
Gitee
or Github
or Gitlab
(gitee plug-in - private code warehouse )
Publish Over SSH
(ssh transfer to another server)
3. Port change
1. Change the configuration file
#更改JENKINS_PORT
vim /etc/sysconfig/jenkins
2. The firewall opens the changed port and restarts
#重启
./jenkins restart
#防火墙开放8083端口
firewall-cmd --zone=public --add-port=8083/tcp --permanent
systemctl restart firewalld #重启
4. Global tool configuration
1. maven configuration
2. jdk configuration
3. git configuration
5. System configuration
Gitee configuration