Hudson:我如何使用参数化构建来执行 svn checkout 和 svn tag? [英] Hudson: how do i use a parameterized build to do svn checkout and svn tag?

查看:37
本文介绍了Hudson:我如何使用参数化构建来执行 svn checkout 和 svn tag?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 hudson v1.362 中设置参数化构建.我正在创建的参数用于确定要在 subversion 中签出的分支.

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.

我可以像这样设置我的 svn 存储库 URL:https://my.svn.server/branches/${branch} 它可以很好地完成结帐和构建.

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.

现在我想在构建完成后对其进行标记.我正在为 hudson 使用 SVN 标记插件来执行此操作.所以我转到 hudson 项目的项目配置屏幕底部并打开在成功构建时执行 Subversion 标记".

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".

在这里,我将我的标记库 URL 设置为 https://my.svn.server/tags/${branch}-${BUILD_NUMBER} 并且它给了我关于找不到这些属性的错误.所以我将它们更改为这样的环境变量用法:https://my.svn.server/tags/${env['branch']}-${env['BUILD_NUMBER']} 和svn标签插件很高兴.

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.

现在的问题是我在顶部的 svn 存储库正在使用 ${branch} 语法和 svn 标记插件 barfs:

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

注意第一行:svn 标签将 ${branch} 视为存储库 url 的一部分......它没有解析出属性值.

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.

我尝试将我的原始存储库 URL 更改为 svn 以使用 ${env['branch']} 语法,但这会在原始结帐时崩溃,因为此语法未在全部由结帐.

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.

帮助?!

如何使用参数化构建来设置 svn url 以用于结帐和标记我的构建?!

how do i use a parameterized build to set the svn url for checkout and for tagging my build?!

推荐答案

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

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

svn cp %workspace% runk@http://myserver/release/%build_number%/trunk-m "(把日志文本放在这里)" --parents

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

也许类似的东西也对你有用.

Perhaps something similar will work for you too.

这篇关于Hudson:我如何使用参数化构建来执行 svn checkout 和 svn tag?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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