触发jenkins建立上存储拉取请求 [英] Trigger jenkins build on stash pull request

查看:1118
本文介绍了触发jenkins建立上存储拉取请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力让公关上的构建工作一段时间,现在遵循通常的指南。但是我遇到了一些问题。

I've been trying to get the build on PR working for some time now following the usual guides. However i ran into some issues.

这是我添加到以前的配置@ Jenkins项目:

Here is what i added to the previously existing configuration @ Jenkins project:

Source Code Management:
Multiple SCMs
 - Repository URL: ssh://git@git.company.pt/projectCode/RepName.git
 - Credentials with ssh key working
 - Batches to build: */${sourceBranch}
 - Repository browser: auto
 - Additional Behaviours: none

Build triggers:
 - Poll SCM

后构建操作

在存储方面没有太多配置。这里是一个ss的现有配置及其测试结果@ Settings - > Hooks - > Stash WebHook to Jenkins:

On the stash side there is not much to configure. Here is a ss of the existing configurations and its test result @ Settings -> Hooks -> Stash WebHook to Jenkins:

正如你在截图中看到的,这个配置的测试工作,它是能够正确地向Jenkins发送消息。 Jenkins收到以下日志消息:

As you can see in the screenshot, the test for this configuration works and it is able to properly send a message to Jenkins. It is received by Jenkins with the following log message:

Started on Apr 29, 2015 8:01:23 AM
Polling SCM changes on master
Using strategy: Default
using GIT_SSH to set credentials 
 > git --version # timeout=10
 > git -c core.askpass=true ls-remote -h ssh://git@git.fraunhofer.pt/glp/golivephone.git # timeout=10
Done. Took 0.18 sec
No changes

对,我没有改变任何东西!
问题是当我去一个实际的分支,点击触发器构建。 Git轮询日志保持完全相同,没有消息发送到Jenkins。我缺少一些配置步骤@存储或在分支创建?我不认为它是相关的jenkins构建,因为我甚至没有得到一个Pooling日志消息时,我触发构建。
即使调试的想法也很高兴找出什么问题。

Right, i didn't change anything! The problem is when i go to an actual branch and click "Trigger build". The Git polling Log stays exactly the same and no messages is sent to Jenkins. Am i missing some configuration step @ stash or in the branch creation? I dont think it is related to the jenkins build, since i dont even get a Pooling log message when i trigger the build. Even a debug idea would be nice to find out what's wrong.

编辑

触发构建时的网络活动:
请求

Network activity when i trigger a build is triggered: Request

Remote Address:10.211.8.19:443
URL:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectCode/repos/repName/triggerJenkins?branch=bugfix/GLP-702-about-screen-doesn-t-update-on-subscription&sha1=cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a
Request Method:POST
Status Code:204 No Content

---PAYLOAD---
none

---Query String parameter---
branch:bugfix/GLP-702-about-screen-doesn-t-update-on-subscription
sha1:cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a

相比测试:

Remote Address:10.211.8.19:443
Request URL:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectCode/repos/repName/test
Request Method:POST
Status Code:200 OK

---PAYLOAD---
{jenkinsBase: ["http://i-255.cloud.fraunhofer.pt:8080/"],…}
gitRepoUrl: ["ssh://git@git.fraunhofer.pt/glp/golivephone.git"]
0: "ssh://git@git.fraunhofer.pt/glp/golivephone.git"
ignoreCerts: ["TRUE"]
0: "TRUE"
jenkinsBase: ["http://i-255.cloud.fraunhofer.pt:8080/"]
0: "http://i-255.cloud.fraunhofer.pt:8080/"
omitHashCode: ["TRUE"]
0: "TRUE"

---Query String parameter---
none


推荐答案

https:// christiangalsterer.wordpress.com/2015/04/23/continuous-integration-for-pull-requests-with-jenkins-and-stash/ 其中我描述了如何设置Jenkins和Stash自动触发的详细步骤

You may have a look at https://christiangalsterer.wordpress.com/2015/04/23/continuous-integration-for-pull-requests-with-jenkins-and-stash/ where I describe the detailed steps how to setup Jenkins and Stash to trigger automatically the correct Jenkins build(s) when a pull request is created or updated.

它使用Jenkins Git插件和收藏夹附加组件的拉入请求通知程序,并使用通知功能选择正确的版本Jenkins Git插件。

It uses the Jenkins Git Plugin and the Pull Request Notifier for Stash add-on and selects the correct build using the notification feature of the Jenkins Git Plugin.

这篇关于触发jenkins建立上存储拉取请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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