Hudson:我如何使用参数化构建来执行 svn checkout 和 svn tag?

发布于 2024-09-06 04:54:11 字数 2240 浏览 3 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小…楫夜泊 2024-09-13 04:54:11

我们不使用标记插件,但我们在 shell 脚本中使用 SVN.EXE,如下所示:

svn cp %workspace%\trunk@
http://myserver/release/%build_number%/trunk
-m“(在此处放置日志文本)”--parents

也许类似的东西也适合您。

We don't use the tagging plugin, but we do use SVN.EXE in our shell script like this:

svn cp %workspace%\trunk@
http://myserver/release/%build_number%/trunk
-m "(put log text here)" --parents

Perhaps something similar will work for you too.

不回头走下去 2024-09-13 04:54:11

我们使用具有以下 URL 的标记插件:

http://subversion.repository/branches/jenkinstest_tags//build-${env['BUILD_NUMBER']}

并且它可以工作。我们必须使用双“//”,如“/jenkinstest_tags//build”。这似乎是一个解决方法。

We use the tagging pluggin with the following URL:

http://subversion.repository/branches/jenkinstest_tags//build-${env['BUILD_NUMBER']}

and it works. We had to use a double '//' as in '/jenkinstest_tags//build' . Which seems to a workaround.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文