Jenkins在收到GitHub webhook时不会触发构建

时间:2018-01-23 10:26:05

标签: git github jenkins configuration

我在设置Jenkins以触发GitHub推送的构建时遇到了麻烦。这是我的Jenkins工作的配置(这里的构建只有touch /tmp/JENKINS_WORKS用于测试目的):

<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.29.0">
      <projectUrl>https://github.com/Mean-Street/cloud_native_app/</projectUrl>
      <displayName></displayName>
    </com.coravy.hudson.plugins.github.GithubProjectProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.7.0">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://github.com/Mean-Street/cloud_native_app.git</url>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>**</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
  <canRoam>true</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers>
    <com.cloudbees.jenkins.GitHubPushTrigger plugin="github@1.29.0">
      <spec></spec>
    </com.cloudbees.jenkins.GitHubPushTrigger>
  </triggers>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command>touch /tmp/JENKINS_WORKS</command>
    </hudson.tasks.Shell>
  </builders>
  <publishers/>
  <buildWrappers/>
</project>

我在GitHub上配置了webhook,正如我在GitHub上看到的那样Jenkins应答200 OK。但Jenkins没有触发这个版本,所以我猜这是Jenkins配置问题。知道可能出现什么问题吗?

由于回购是公开回购,我认为我不需要向Jenkins提供任何凭据来访问它,是吗?

提前感谢您的任何帮助或建议。

1 个答案:

答案 0 :(得分:1)

这是一个jenkins Github插件问题。 https://issues.jenkins-ci.org/browse/JENKINS-49332

我有这个问题,1.0.29降级到1.0.27应该可以解决你的问题。