move Hudson job to another server

2019-03-25 16:02发布

I've setup a continuous integration build with Hudson running on Tomcat. I now need to move this a different instance of Tomcat, but don't want to have to configure everything from scratch.

Is there a configuration file that defines each job which I could copy to the new server, or is to possible to import/export a job via the user interface?

Thanks, Don

6条回答
Deceive 欺骗
2楼-- · 2019-03-25 16:34

When we migrated to a new server we just copied the jobs folder over to the new server. There can be a huge amount of data in the builds folder in each job, so we left those out.

Everything worked fine for us after the transfer but we had a fairly simple initial setup.

查看更多
走好不送
3楼-- · 2019-03-25 16:41

Since I cannot up-vote, I will add that Simon's answer is the best. The link to the relevant section about copying and moving jobs can be found at the following location: http://wiki.hudson-ci.org/display/HUDSON/Administering+Hudson#AdministeringHudson-Moving/copying/renamingjobs

查看更多
Emotional °昔
4楼-- · 2019-03-25 16:45

Check the .hudson directory in the homedir of the user that runs the hudson process. (At least: that is the location hudson writes its config files to if you run it using java -jar hudson.war on linux).

Also: http://wiki.eclipse.org/Administering_Hudson

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-03-25 16:45

job import plugin will do. Import jobs from another Jenkins instance.

Here is Jenkins Job import plugin :

https://wiki.jenkins-ci.org/display/JENKINS/Job+Import+Plugin

查看更多
姐就是有狂的资本
6楼-- · 2019-03-25 16:46

One best practice is to create an environment variable HUDSON_HOME on the server running Hudson. This variable name will be used by Hudson to store all configuration and job data.

Without this variable Hudson will create a folder under $USERHOME/.hudson (On Windows it will be c:\Documents and Settings[user].hudson].

One advantage of using HUDSON_HOME variable is that it will allow you to start Hudson with any user, what is somehow common when using a remote Windows server to host.

查看更多
干净又极端
7楼-- · 2019-03-25 16:57

In the jobs/[job name] directory there is a config.xml file. This is the one I typically mark for backup when I backup a new Hudson job.

You should be able to just copy it over and maybe modify minor details, depending on your Hudson setup and environment variables.

查看更多
登录 后发表回答