詹金斯钩不工作 - 詹金斯bitbucket [英] jenkins hook not working - jenkins bitbucket

查看:190
本文介绍了詹金斯钩不工作 - 詹金斯bitbucket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我使用jenkins和bitbucket,当我向bitbucket存储库提交任何内容时,我想触发jenkins中的构建。



jenkins




  • 我创建了一个名为 test_1
  • $ b的项目$ b
  • 在配置部分构建触发器部分我打勾触发器远程构建

  • 我添加了一个令牌 TEST_TOKEN



浏览器url并执行jenkins构建触发

  http://test.com:8080/job/test_1//build? token = TEST_TOKEN 

在bitbucket中



我添加了 jenkins hook





然后通过git提交了一些代码给bitbucket,jenkins没有运行,似乎触发器没有运行。 :/ 如何解决这个问题呢 。请帮帮我 。提前感谢:)

解决方案

我有同样的问题。 @fmitchell对这些领域的建议是正确的。
但它不适用于我。



我使用普通的POST Hook,而不是提供整个URL的地方:

  http:// USER_NAME:USER_TOKEN@YOUR.JENKINS.URL.COM:YOUR_PORT / job / YOUR_PROJECT_NAME / build?token = some_token_from_jenkins 

例如:http://bob.miller@jenkins.example.com:8080 / job / test_1 / build?token = TEST_TOKEN

似乎是Bitbuckt在其创建的URL中缺少最后一个参数build,但我无法确定。



------更新------



我发现了一个更好的解决方案,您不仅可以触发构建但也可以通过不同的Jenkins项目建立不同的分支:




  • 安装 Bitbucket Plugin 在您的Jenkins

  • 在您的Bitbucket存储库中添加一个普通Post作为Hook >设置 - >钩子)并使用以下url:




https:// YOUR.JENKINS.SERVER:PORT / bitbucket -hook




  • 配置您的Jenkins项目如下:

      源代码管理下启用构建触发器启用将更改推送到BitBucket
    • >选择 GIT ;输入您的凭证并定义要生成的分支(如 ** feature / *


    通过这种方式,我有三个构建项目,一个用于所有功能,一个用于开发,一个用于发布分支。

    最好的是,您不必为新的Jenkins项目添加新的钩子。


    Hi i am using jenkins and bitbucket , i want to trigger a build in jenkins when ever i commit any thing to bitbucket repository .

    in jenkins

    • i created a project called test_1
    • in configure section Build Triggers part i ticked Trigger builds remotely
    • i added a token TEST_TOKEN

    when i type this in my browser url and execute the jenkins build is triggered

    http://test.com:8080/job/test_1//build?token=TEST_TOKEN 
    

    In bitbucket

    i added a jenkins hook

    then commited some code to bitbucket via git , The jenkins build not running , seems that the trigger is not running . :/ how to solve this problem . please help me . thanks in advance :)

    解决方案

    I had the same problem. @fmitchell is correct with his suggestions for these fields. But it didn't work for me.

    I use a normal POST Hook instead where I provide the whole URL:

    http://USER_NAME:USER_TOKEN@YOUR.JENKINS.URL.COM:YOUR_PORT/job/YOUR_PROJECT_NAME/build?token=some_token_from_jenkins
    
    eg: http://bob.miller@jenkins.example.com:8080/job/test_1/build?token=TEST_TOKEN
    

    It seems to be that Bitbuckt is missing the last parameter "build" in its created URL, but I can't tell for sure.

    ------Update------

    I found a better solution, where you don't only trigger your build but also be able do build different branches by different Jenkins projects:

    • Install Bitbucket Plugin at your Jenkins
    • Add a normal Post as Hook to your Bitbucket repository (Settings -> Hooks) and use following url:

    https://YOUR.JENKINS.SERVER:PORT/bitbucket-hook

    • Configure your Jenkins project as follows:
      • under build trigger enable Build when a change is pushed to BitBucket
      • under Source Code Management select GIT; enter your credentials and define Branches to build (like **feature/*)

    By this way I have three build projects, one for all features, one for develop and one for release branch.

    And best of it, you don't have to ad new hooks for new Jenkins projects.

    这篇关于詹金斯钩不工作 - 詹金斯bitbucket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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