卸载jenkins
sudo apt-get remove jenkins
sudo apt-get purge jenkins
sudo apt-get purge --auto-remove jenkins
1.安装JDK
ln -s /java/jdk1.8.0_231/bin/java /usr/bin/java
配置Jdk软连接
2.安装jenkins命令
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
3.启动jenkins
sudo /etc/init.d/jenkins [start|restart|stop]
4.查看安装密码
cat /var/lib/jenkins/secrets/initialAdminPassword
5.打开浏览器http://192.168.215.50:8080 (如果服务器上装过tomcat,请更改jenkins的端口)
$ sudo vi /etc/default/jenkins
#修改如下内容
HTTP_PORT=8085
#重启jenkins服务
$ sudo /etc/init.d/jenkins restart
输入刚才查询的密码
6.选择推荐安装插件