我如何让 Jenkins 建立在推送到 BitBucket git 存储库的基础上? [英] How do I get Jenkins to build on push to a BitBucket git repository?

查看:21
本文介绍了我如何让 Jenkins 建立在推送到 BitBucket git 存储库的基础上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 BitBucket 上托管了一个 git 存储库,并且在存储库和我的 Jenkins 服务器之间设置了 SSH 身份验证.我可以手动在 Jenkins 上构建,但无法让 BitBucket 上的 Jenkins 服务触发构建.

I have a git repository hosted on BitBucket, and have set up SSH authentication between the repository and my Jenkins server. I can build on Jenkins manually, but cannot get the Jenkins service on BitBucket to trigger builds.

Jenkins configuration:  
- Project Name: [my_jenkins_job]  
- Build Triggers:  
--Trigger Builds Remotely:  
---Token: [token]

BitBucket configuration:  
- Endpoint: http://[my_jenkins_address]/job/[my_jenkins_job]/build (I've also tried build?token=[token])  
- Project Name: [my_jenkins_job]  
- Module Name: [blank]  
- Token: [token]

访问 http://{my_jenkins_address}/job/{my_jenkins_job}/build?token={token} 正确启动构建.

Visiting http://{my_jenkins_address}/job/{my_jenkins_job}/build?token={token} kicks off a build properly.

为什么推送对 BitBucket 的更改不会导致 Jenkins 启动构建?

Why doesn't pushing a change to BitBucket cause Jenkins to initiate a build?

推荐答案

我将 Jenkins 实例设置为每分钟轮询存储库.这对您的需求来说还不够频繁吗?

I have our Jenkins instance set up to poll the repository every minute. Is that not frequent enough for your needs?

我们的 Jenkins 配置:

构建触发器 > 轮询 SCM = 已检查

Build Triggers > Poll SCM = Checked

构建触发器> 轮询 SCM > 计划 =

Build Triggers > Poll SCM > Schedule =

# every 1 minute
*/1 * * * *

这篇关于我如何让 Jenkins 建立在推送到 BitBucket git 存储库的基础上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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