jenkins - Bitbucket和Jenkins远程构建触发器

标签 jenkins bitbucket webhooks

我要达到的目的

使用Jenkins中的远程触发选项创建拉取请求时,从Bitbucket触发构建。因此,我在Jenkins中创建了一个作业,并配置为使用远程API触发构建。

Enter image description here

在Bitbucket中,我创建了一个Webhook来触发具有以下URL结构的构建:

http://jenkins_server_ip:port/job/job-name/build?token=<t1>

我收到以下错误:
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
        <title>Error 403 No valid crumb was included in the request</title>
    </head>
    <body>
        <h2>HTTP ERROR 403</h2>
        <p>Problem accessing /job/android-sample/build. Reason:

            <pre>    No valid crumb was included in the request</pre>
        </p>
        <hr>
        <a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a>
        <hr/>
    </body>
</html>

我深入研究了互联网,有人说我们需要在Jenkins中使用crumbIssuer API,这是通过wget完成的。如何在Bitbucket中使用它?

最佳答案

您可以在以下位置关闭CSRF安全检查:系统配置→配置全局安全→CSRF保护,然后取消选中该复选框。

关于jenkins - Bitbucket和Jenkins远程构建触发器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45306089/

相关文章:

git - 是否可以将 'fork" repo 到特定提交?

python - webhook 可以直接针对 GCP PubSub 吗?

webhooks - 通过 Dialogflow webhook fulfillment 向 Actions on Google 发回丰富的响应

python - .pypirc 文件的自定义位置

android - 来自 Bitbucket 管道的权限被拒绝

git - 搞砸了本地 git 存储库 - 如何将 "revert a revert"再次匹配上次远程提交?

webhooks - 保护您的 facebook chatbot webhook 的最佳实践是什么?

jenkins - 如果项目质量门失败,如何在 sonarqube 5.1+ 上使用 Build Breaker

Kubernetes 节点上的 Jenkins 提示其插件需要更新版本的 Jenkins,但又不想丢失数据

java.lang.NoSuchMethodError : org. sonar.api.resources.Project.getConfiguration()Lorg/apache/commons/configuration/配置