Jenkins re-run setup wizard

妖精的绣舞 提交于 2021-02-07 14:17:00

问题


Just installed latest Jenkins on Windows server.
Changed it to run as a service and my login no longer works. No problems, disable security for now.

But found out all my plug-ins are missing.
How can I have it rerun the setup wizard?


回答1:


As seen in issue 310, you need on the server side to remove:

/usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
/usr/share/jenkins/ref/jenkins.install.InstallUtil.lastExecVersion

(Search those files on your Windows Jenkins installation folder, to adapt those paths accordingly)

And you would relaunch Jenkins with -Djenkins.install.runSetupWizard=true




回答2:


I installed Jenkins through apt and my solution was a little different.

For Jenkins v2.140 I had to edit /var/lib/jenkins/config.xml and change the following line:

<installStateName>NEW</installStateName>

to

<installStateName>RUNNING</installStateName>

then restart Jenkins:

sudo service jenkins restart

Here is everything above in a script:

#! /bin/bash

sudo sed -i 's#<installStateName>NEW.*#<installStateName>RUNNING<\/installStateName>#g' /var/lib/jenkins/config.xml
sudo service jenkins restart

Please note you will have to install all plugins and create users manually. I used the Jenkins CLI



来源:https://stackoverflow.com/questions/45698445/jenkins-re-run-setup-wizard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!