Linux installation jenkins (operating system CentOS)

Because I am still using jdk1.8, I downloaded the jenkins 2.346.1 version, because jenkins 2.346.1 is the last version that supports jdk1.8.

1. Download from jenkins official website

Jenkins official website address
insert image description here
insert image description here
insert image description here
Download jenkins.war, and then put it in tomcat to start
ps: If tomcat has not been installed, see my blog post about installing tomcat

2. Jenkins installation and deployment

Deploy using tomcat
insert image description here

Start tomcat, you will see one more jenkins directory after success
insert image description here

Visit jenkins: http://IP:port/jenkins
The first page is to let you unlock Jenkins,
insert image description here
he will tell you that the password has been output on the console, if you can't find it, use the above command to go to the server where jenkins is located Execute, you will see the password

Excuting an order

[root@localhost logs]# cat /root/.jenkins/secrets/initialAdminPassword

After successful execution, the administrator password will appear, ebce571d213848fb831459c1dbadebc1 is the administrator password
insert image description here
Use the administrator password to continue
insert image description here
Click Continue to jump to the following page for you to install the plug-in, here I choose the recommended plug-in installation, the progress
insert image description here
bar is full, the installation is successful
insert image description here
here Plug-in installation failed, ignore it, click to continue
insert image description here

If you choose to use the admin account to continue, the user name for logging in to Jenkins next time is admin, and the password is the initial password above

If you choose to save and complete, the next time you log in to Jenkins, you will log in with the administrator user and password you created this time. Keep it
insert image description here
and finish .
insert image description here
You can log in
insert image description here
. The first time you log in successfully by default, you need to log in with the admin account next time.
insert image description here

3. Jenkins plug-in installation failure solution

There was a plug-in installation that failed during the installation just now.
insert image description here

solution

1. Switch the download source address

The plug-in that failed to install just now
insert image description here
Click Correct
insert image description here
Click Advanced
insert image description here
to replace the URL (you can see it at the bottom)
insert image description here
New RUL

https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json​

insert image description here

2. Modify the server configuration

Return to the page below
insert image description here
, scroll to the bottom to see [Plug-in Management]
insert image description here
and click [Get Now]
insert image description here

After clicking, go back to the server to stop tomcat, and then go back to the root directory

[root@localhost ~]# cd /root
[root@localhost ~]# ls -a

You can see .jenkins, go
insert image description here
in and modify the default.json file

[root@localhost ~]#  cd .jenkins/updates/
[root@localhost updates]# ls

You can see that there is a default.json file
insert image description here
edit content

[root@localhost updates]# vim default.json 

insert image description here

Replace www.google.com with www.baidu.com

Hold Shift+: and enter

%s/www.google.com/www.baidu.com/g

insert image description here
Then globally replace https://updates.jenkins.io/download/ - to https://mirrors.tuna.tsinghua.edu.cn/jenkins/

%s/https:\/\/updates.jenkins.io\/download\//https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins\//g

After the replacement, be careful not to execute the [Get Now] update plugin list button at the bottom, otherwise the content of default.json will be changed.

start tomcat again
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq407995680/article/details/132364308
Recommended