这可能是由于Bitbucket不发送有效的POST数据来触发Jenkins job所致。解决此问题的方法是添加一些应该由Bitbucket发送的参数,例如git repository的地址。以下是一个示例的Jenkinsfile:
pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Running Example Build'
}
}
}
post {
success {
echo 'Build Success! :)'
}
failure {
echo 'Build Failure :('
}
}
}
在Bitbucket的Webhook设置中,将“Jenkins URL”设置为Jenkins服务器的URL,并添加以下参数:
{
"parameter": [
{
"name": "repository",
"value": "https://bitbucket.org//.git"
}
]
}
请注意将