使用 Jenkins CLI 在 Jenkins 中获取给定内部版本号的最新更改
Get Recent Changes for Given Build Number in Jenkins using Jenkins CLI
我想使用命令提示符获取给定作业的内部版本号到内部版本号的最新更改列表。
例如,我在 Jenkins 中创建了 XYZ 作业,最新版本是 101、102、103、104。使用 jenkins-cli.jar,我想执行一个命令,我可以在其中获取最近的列表在 101 到 104 之间进行的更改。我使用 SVN 作为存储库。
有什么想法吗?
您可以访问 http://jenkins:8080/cli
.
获取 Jenkins CLI 支持的命令列表
Jenkins CLI 提供list-changes
命令:
$ java -jar jenkins-cli.jar -s http://jenkins:8080/ help list-changes
java -jar jenkins-cli.jar list-changes JOB RANGE [-format [XML | CSV | PLAIN]]
Dumps the changelog for the specified build(s).
JOB : Name of the job to build
RANGE : Range of the build records to delete. 'N-M',
'N,M', or 'N'
-format [XML | CSV | PLAIN] : Controls how the output from this command is
printed.
"Range of the build records to delete" 应该读作 "Range of the build records to list changes for"
以你的例子为例:
$ java -jar jenkins-cli.jar -s http://jenkins:8080/ list-changes XYZ 101-104
我想使用命令提示符获取给定作业的内部版本号到内部版本号的最新更改列表。
例如,我在 Jenkins 中创建了 XYZ 作业,最新版本是 101、102、103、104。使用 jenkins-cli.jar,我想执行一个命令,我可以在其中获取最近的列表在 101 到 104 之间进行的更改。我使用 SVN 作为存储库。
有什么想法吗?
您可以访问 http://jenkins:8080/cli
.
Jenkins CLI 提供list-changes
命令:
$ java -jar jenkins-cli.jar -s http://jenkins:8080/ help list-changes
java -jar jenkins-cli.jar list-changes JOB RANGE [-format [XML | CSV | PLAIN]]
Dumps the changelog for the specified build(s).
JOB : Name of the job to build
RANGE : Range of the build records to delete. 'N-M',
'N,M', or 'N'
-format [XML | CSV | PLAIN] : Controls how the output from this command is
printed.
"Range of the build records to delete" 应该读作 "Range of the build records to list changes for"
以你的例子为例:
$ java -jar jenkins-cli.jar -s http://jenkins:8080/ list-changes XYZ 101-104