archive/restore 选择詹金斯工作的最佳方式是什么
What is the best way to archive/restore selected jenkins job
我想知道什么是最好的方式来存档你未使用的 job.Is 有什么插件可以让我们存档选定的 Jenkins 作业并在我们认为需要时稍后恢复它们。
现在我正在复制作业文件夹并在删除作业日志后将其归档。为了恢复,我正在将此目录恢复回 Jenkins 中的作业目录。
我不知道最佳答案,但我已经创建了一个 python 脚本来完成这项工作,
你可以得到相同的
https://github.com/thinkingmonster/pythonscripts
This module provides facility to take easy backup of Jenkins jobs which needs to be archived.It provided the facility where you can either provide a single jobname to be archived or multiple job names written inside a file and passing file path as an argument to the script.Script can be run as shown below.
<h6>How to use module </h6>
- Pull the files and place them at /opt
- TakeInput.py is the main file execute the same to start the program.
- Alternatively you can also create a softlink to the same in /bin and use soft-link as command.
```
python TakeInput.py -n <jobname>
```
<br>
<table style="width:100%">
<tr>
<th>Option</th>
<th>Explain</th>
</tr>
<tr>
<td>-h</td>
<td>Prints help menu</td>
</tr>
<tr>
<td>-n</td>
<td>Provide job name or full job name(absolute path) as input</td>
</tr>
<tr>
<td>-f</td>
<td>Provide input file path(absolute path)</td>
</tr>
<tr>
<td>-b</td>
<td>Provide backup location,ie location where you want the archived job to be placed<br>
default is /tmp location</td>
</tr>
<tr>
<td>-r</td>
<td>This option works when you want to restore an archived job back to the Jenkins<br> environment.You can provide absolute
path of job archive or absolute path of directory containing job archives for mass restore</td>
</tr>
</table>
Shelve Project plugin 正是这样做的。
来自维基页面:
This plugin lets you "shelve" projects so that they can easily be resurrected. When you shelve a project, it'll disappear from the list of projects [...] instead of getting deleted, the data is archived into a zip file and stored on the server [...] This allows the administrator to resurrect it later.
Jenkins 的 Job Config History 插件间接包含此内容。删除的作业进入一种回收站,可以通过从主页 (/jobConfigHistory) 转到作业配置历史来恢复。由于配置历史插件无论如何都非常有用,这是一个很好的奖励。
我想知道什么是最好的方式来存档你未使用的 job.Is 有什么插件可以让我们存档选定的 Jenkins 作业并在我们认为需要时稍后恢复它们。 现在我正在复制作业文件夹并在删除作业日志后将其归档。为了恢复,我正在将此目录恢复回 Jenkins 中的作业目录。
我不知道最佳答案,但我已经创建了一个 python 脚本来完成这项工作, 你可以得到相同的 https://github.com/thinkingmonster/pythonscripts
This module provides facility to take easy backup of Jenkins jobs which needs to be archived.It provided the facility where you can either provide a single jobname to be archived or multiple job names written inside a file and passing file path as an argument to the script.Script can be run as shown below.
<h6>How to use module </h6>
- Pull the files and place them at /opt
- TakeInput.py is the main file execute the same to start the program.
- Alternatively you can also create a softlink to the same in /bin and use soft-link as command.
```
python TakeInput.py -n <jobname>
```
<br>
<table style="width:100%">
<tr>
<th>Option</th>
<th>Explain</th>
</tr>
<tr>
<td>-h</td>
<td>Prints help menu</td>
</tr>
<tr>
<td>-n</td>
<td>Provide job name or full job name(absolute path) as input</td>
</tr>
<tr>
<td>-f</td>
<td>Provide input file path(absolute path)</td>
</tr>
<tr>
<td>-b</td>
<td>Provide backup location,ie location where you want the archived job to be placed<br>
default is /tmp location</td>
</tr>
<tr>
<td>-r</td>
<td>This option works when you want to restore an archived job back to the Jenkins<br> environment.You can provide absolute
path of job archive or absolute path of directory containing job archives for mass restore</td>
</tr>
</table>
Shelve Project plugin 正是这样做的。
来自维基页面:
This plugin lets you "shelve" projects so that they can easily be resurrected. When you shelve a project, it'll disappear from the list of projects [...] instead of getting deleted, the data is archived into a zip file and stored on the server [...] This allows the administrator to resurrect it later.
Jenkins 的 Job Config History 插件间接包含此内容。删除的作业进入一种回收站,可以通过从主页 (