设置 Bamboo SVN 提交构建触发器
Bamboo CI 有一个内置功能,当有人提交到存储库时,颠覆程序会触发 Bamboo 中的构建。我按照在提交后挂钩中放置内容的说明进行操作,但我不确定 postcommitbuildtrigger.sh 文件的两个参数应该是什么。假设项目名称为 TEST,构建名称为 TESTBUILD,服务器 URL 为 http://localhost:8085。我在 post commit hook 命令行中写了这个。
/<pathtopostcommit.sh> TEST TESTBUILD
问题
提交后 .sh 文件位于 Windows 计算机上。这可能是因为 Windows 不运行 .sh 文件,但如果是这样,有人知道如何在 Windows 上设置此触发器吗?
另外,我认为这会立即触发构建?是否有可能触发竹子进行民意调查,以便构建将遵守安静期?
Bamboo CI has a build in feature of having the subversion program trigger a build in bamboo when someone commits to the repository. I followed the instructions of what to put in the post commit hook but I am not sure what the 2 arguments are supposed to be for the postcommitbuildtrigger.sh file. Lets say the project name is TEST and the build name is TESTBUILD and the server url is http://localhost:8085. I wrote this in the post commit hook command line.
/<pathtopostcommit.sh> TEST TESTBUILD
Question
The post commit .sh file is on a windows machine. It could be because windows doesnt run .sh files but if thats so does anyone know how to set up this trigger on windows?
Also, I think this will trigger a build immediatly? Is is possible to trigger bamboo to run a poll instead so the build will obey the quiet period?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
必须编写自己的脚本。 Bamboo 只分发 mac 和 linux 脚本。
Have to write your own scripts. Bamboo only distributes mac and linux scripts.
好吧,我自己写的。这比颠覆轮询超时要好得多。测试环境:
BambooWebApiTrigger.bat
C:\SvnHooks\
中 PowerShell 的批处理文件运行程序:BambooWebApiTrigger.ps1
用于运行 System.Net.WebClient 的 PowerShell 脚本,也在
C:\SvnHooks\< /代码>。使用本地 Bamboo 服务器覆盖 bamboo.yourdefaultdomain.com:
配置 VisualSvn
在 VisualSvn 服务器管理器中右键单击项目 >属性>挂钩>提交后挂钩(编辑)。
在任何其他行之后输入此行:
其中 BambooProjectKey 是密钥,在浏览构建计划(而不是项目)时在您的amboo url后面找到。它通常有一个连字符:
http://bamboo.yourdomain.com:8085/browse/FOO-BAR
。在这种情况下,FOO-BAR 将是关键。配置 Bamboo
将 Bamboo 触发器更改为存储库在提交更改时触发构建
选项
您可以覆盖 VisualSvn 提交后挂钩对话框中的密钥,以及批处理中的 Bamboo 基本 URL 和临时文件位置文件运行程序。
Ok I wrote my own. It's so much nicer than subversion poll time-outs. Tested on:
BambooWebApiTrigger.bat
A batch file runner for PowerShell in
C:\SvnHooks\
:BambooWebApiTrigger.ps1
A PowerShell script to run System.Net.WebClient, also in
C:\SvnHooks\
. Overwrite bamboo.yourdefaultdomain.com with your local Bamboo server:Configure VisualSvn
Right click on project in VisualSvn Server Manager > Properties > Hooks > Post-commit hook (Edit).
Enter this line after any others:
where BambooProjectKey is the key, found after your bamboo url when browsing the Build Plan (not the project). It usually has a hyphen in it:
http://bamboo.yourdomain.com:8085/browse/FOO-BAR
. In this case, FOO-BAR would be the key.Configure Bamboo
Change your Bamboo trigger to Repository triggers the build when changes are committed
Options
You can overwrite the key from the VisualSvn post-commit hook dialog, as well as Bamboo base URL and temp file location from the batch file runner.