Hudson:我如何使用参数化构建来执行 svn checkout 和 svn tag?
我正在 hudson v1.362 中设置参数化构建。我正在创建的参数用于确定在 subversion 中检出哪个分支。
我可以像这样设置我的 svn 存储库 url: https://my.svn.server/branches/ ${branch}
它可以很好地进行结帐和构建。
现在我想在构建完成后对其进行标记。我正在使用 hudson 的 SVN 标记插件来执行此操作。所以我转到 hudson 项目的项目配置屏幕底部,并打开“在成功构建时执行 Subversion 标记”。
在这里,我将标签基本 URL 设置为 https://my.svn.server/tags/< /a>${branch}-${BUILD_NUMBER}
它给了我关于未找到这些属性的错误。所以我将它们更改为环境变量用法,如下所示: https://my.svn.server/tags /${env['branch']}-${env['BUILD_NUMBER']}
和 svn 标记插件很高兴。
现在的问题是我顶部的 svn 存储库使用 ${branch}
语法和 svn 标记插件 barfs:
moduleLocation: Remote ->https://my.svn.server/branches/$branch/
Tag Base URL: 'https://my.svn.server/tags/thebranchiused-1234'.
There was no old tag at https://my.svn.server/tags/thebranchiused-1234.
ERROR: Publisher hudson.plugins.svn_tag.SvnTagPublisher aborted due to exception
java.lang.NullPointerException
at hudson.plugins.svn_tag.SvnTagPlugin.perform(SvnTagPlugin.java:180)
at hudson.plugins.svn_tag.SvnTagPublisher.perform(SvnTagPublisher.java:79)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:167)
at hudson.model.Run.run(Run.java:1295)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:124)
Finished: FAILURE
注意第一行:svn 标记正在查看 ${ branch} 作为存储库 url 的一部分...它不会解析属性值。
我尝试更改 svn 的原始存储库 URL 以使用 ${env['branch']}
语法,但这在原始结账时失败了,因为该语法根本没有被解析查看。
帮助?!
我如何使用参数化构建来设置用于结帐和标记我的构建的 svn url?
I'm setting up a parameterized build in hudson v1.362. the parameter i'm creting is used to determine which branch to checkout in subversion.
I can set my svn repository url like this: https://my.svn.server/branches/${branch}
and it does the checkout and the build just fine.
now I want to tag the build after it finishes. i'm using the SVN tagging plugin for hudson to do this. so i go to the bottom of the project config screen for the hudson project and turn on "Perform Subversion tagging on successful build".
here, i set my Tag Base URL to https://my.svn.server/tags/${branch}-${BUILD_NUMBER}
and it gives me errors about those properties not being found. so i change them to environment variable usages like this: https://my.svn.server/tags/${env['branch']}-${env['BUILD_NUMBER']}
and the svn tagging plugin is happy.
the problem now is that my svn repository at the top is using the ${branch}
syntax and the svn tagging plugin barfs on this:
moduleLocation: Remote ->https://my.svn.server/branches/$branch/
Tag Base URL: 'https://my.svn.server/tags/thebranchiused-1234'.
There was no old tag at https://my.svn.server/tags/thebranchiused-1234.
ERROR: Publisher hudson.plugins.svn_tag.SvnTagPublisher aborted due to exception
java.lang.NullPointerException
at hudson.plugins.svn_tag.SvnTagPlugin.perform(SvnTagPlugin.java:180)
at hudson.plugins.svn_tag.SvnTagPublisher.perform(SvnTagPublisher.java:79)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:167)
at hudson.model.Run.run(Run.java:1295)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:124)
Finished: FAILURE
notice the first line, there: the svn tag is looking at ${branch} as part of the repository url... it's not parsing out the property value.
i tried to change my original Repository URL for svn to use the ${env['branch']}
syntax, but that blows up on the original checkout because this syntax is not getting parsed at all by the checkout.
help?!
how do i use a parameterized build to set the svn url for checkout and for tagging my build?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们不使用标记插件,但我们在 shell 脚本中使用 SVN.EXE,如下所示:
也许类似的东西也适合您。
We don't use the tagging plugin, but we do use SVN.EXE in our shell script like this:
Perhaps something similar will work for you too.
我们使用具有以下 URL 的标记插件:
并且它可以工作。我们必须使用双“//”,如“/jenkinstest_tags//build”。这似乎是一个解决方法。
We use the tagging pluggin with the following URL:
and it works. We had to use a double '//' as in '/jenkinstest_tags//build' . Which seems to a workaround.