工作中要安装一个插件但当前jenkins版本过低,在scmlife搜索了下没有jenkins升级相关资料,今天升级后特意做下记录分享给我大家,记录比较详细,高手就飘过吧 。为避免不必要的麻烦,以下请在Jenkins Home机器进行操作:
1.在jenkins系统设置界面发现类似如下提示:New version of Jenkins (1.500) is available for download (changelog).下载最新版本jenkins.war
2.[scm@Linux jenkins]$ ps -aux | grep jenkins #查看jenkins安装路径,下方红色字体
...
jenkins 19139 30.8 7.0 1496412 273816 ? Ssl 15:24 11:18 /usr/lib/jvm/jre-1.6.0/bin/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8888 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
...
3.[scm@Linux jenkins]$cd /usr/lib/jenkins/ #进入jenkins目录,建议此时备份原来的jenkins.war
4.[scm@Linux jenkins]$sudo rcjenkins stop #关闭jenkins服务
5.[scm@Linux jenkins]sudo cp -i /home/scm/public/jenkins.war ./ #覆盖原因来jenkins
6.[scm@Linux jenkins]sudo rcjenkins start #启动jenkins服务)
7.好了,升级ok,可以看到版本已升级到最新了,但是此时管理界面出现了一些提示:
Because of a security vulnerability discovered earlier, we need to change the encryption key used to protect secrets in your configuration files on the disk. This process scans a large portion of your $JENKINS_HOME (/var/lib/jenkins), find encrypted data, re-key them, which will take some time. See this document for more implications about different ways of doing this (or not doing this.) This operation can be safely run in background, but cautious users are recommended to take backups.3 R* }/
单击 “Re-key in background now”按钮即对整个Jenkins Home进行校验,一般需要1-2天的时间。可以在日志里查看进度。