1. First download the jenkins war package
Note that it matches the jdk version
https://www.jenkins.io/zh/download/
2. Configure jenkins environment variables
If you do not configure environment variables, the main directory of Jenkins is generated under the c drive by default.
How to configure environment variables? Please Baidu yourself
3. Run the jar package
Pay attention to modifying the war package path
java -jar /data/jenkins/jenkins.war --httpPort=8763
4. Modify the jenkins image source
Find the file hudson.model.UpdateCenter.xml in the directory of the jenkins environment variable
and modify the address to the Ali mirror:
https://mirrors.aliyun.com/jenkins/updates/update-center.json
5.Access jenkins
Add the server IP to the startup port
. Check the war running log and enter the secret key.
Install the recommended plug-in and wait for the installation to complete.
6. Install the gitlab plug-in and configure it
Log in to gitlab and enter the token information acquisition page
Enter the name, select api, click the generate button, and then copy for backup
! [Insert picture description here](https://img-blog.csdnimg.cn/e00d706d77124f4b80e5ee53b7b63b31.png
Log in to jenkins and click System Management -> Plug-in Management -> Search gitlab Installation
Restart jenkins
7 Configure gitlab
Enter the gitlab configuration page,
fill in the name, customize the name,
fill in the gitlab domain name
, click Add, and select Jenkins
Type select gitlab api token
api token to fill in the token just generated in gitlab
and then enter a custom id
to go back to the page just added and select the authentication token just added. Then save
so far, the relevant configuration has been completed, if there is no maven plug-in to continue Search maven in the plug-in management and install the maven plug-in.