在Jenkins Pipeline中构建特定的修订版 [英] Building a particular revision in Jenkins Pipeline

查看:191
本文介绍了在Jenkins Pipeline中构建特定的修订版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SVN作为我的源代码控制存储库,并使用Jenkins作为我的CI工具.我使用Jenkins运行MSBuild脚本来进行实际的构建和部署.我还使用Jenkins Pipeline插件来管理下游项目的构建.

I am using SVN as my source control repository and Jenkins as my CI tool. I run MSBuild scripts using Jenkins to do the actual builds and deploys. I also use the Jenkins Pipeline plugin to do manage the building of downstream projects.

我的管道有问题.问题是,比如说我已经完成了10次到SVN的签入,结果进行了10次自动CI构建,结果管道显示了10次构建.现在,如果我想将内部版本号5推入管道的下一个阶段,我希望直到第五个内部版本的所有代码都将被构建到下一个阶段,相反,最新的代码(内部版本10)是一直被使用.

I have an issue with the pipeline. The problem is that, say I have done 10 check-ins into SVN and as a result 10 automatic CI builds have taken place, and as a result of that the pipeline shows 10 builds. Now, if I want to push build number 5 to the next stage in the pipeline I would expect all the code up to the fifth build to be built to the next stage, instead what is happening is that the latest code (build 10) is being used all the time.

我不知道我是否需要修改构建脚本,是否需要配置Jenkins或是否需要配置管道插件.有人知道吗?

I don't know whether I need to modify my build script or whether I need to configure Jenkins or whether I need to configure the pipeline plugin. Does anyone know?

以防万一,您可能不知道管道插件的含义,这是屏幕截图.

Just in case you don't know what I mean by the pipeline plugin, here is a screenshot.

推荐答案

您可以将@1234添加到SVN位置的 SVN_URL 中. (请参见 https://stackoverflow.com/a/2325478/834 )

You can add @1234 to your SVN_URL in the SVN location. (see https://stackoverflow.com/a/2325478/834)

您还可以使用环境变量 SVN_REVISION 来获取修订版本,并在SVN位置使用类似@${SVN_REVISION}的名称.可在 https://wiki上找到文档. jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables .

You can also use the environment variable SVN_REVISION to get the revision and use something like @${SVN_REVISION} in your SVN location. Documentation is available at https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables.

这篇关于在Jenkins Pipeline中构建特定的修订版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆