[英]Building Feature Branches using BitBucket and Jenkins and MSBUILD
[英]Jenkins - Bitbucket PR builder not building correct branches
我正在設置我的Jenkinsfile,以允許在為任何分支(僅在PR上)進行的每個bitbucket PR上構建測試。 但是,創建PR時,該插件似乎針對每個分支構建。 這是插件的錯誤嗎? 我正在使用Bitbucket Pull Request Builder插件1.4.30
我的觸發如下
triggers{
- bitbucketpr(projectPath:'bitbucket.org/testrepo/django-db.git',
- cron:'* * * * *',
- credentialsId:'jenkins_pr_test',
- repositoryOwner:'testrepo',
- repositoryName:'django-db',
- branchesFilter:"*/dev",
- branchesFilterBySCMIncludes:false,
- ciKey:'jenkins',
- ciName:'jenkins',
- ciSkipPhrases:'',
- checkDestinationCommit:false,
- approveIfSuccess:false,
- cancelOutdatedJobs:true,
- commentTrigger:'')
- pollSCM('H/5 * * * *')
- }
我什至嘗試以下僅針對特定分支進行構建,但該插件仍會構建所有分支。
- branchesFilter:"*/${BRANCH_NAME}"```
有任何想法嗎?
我的階段如下
stage('Build and Test Docker image') {
when { branch "${BRANCH_NAME}" }
steps {
script {
docker.withRegistry("${env.ECR_URL}", "ecr:us-east-1:ecrAccess") {
customImage = docker.build("${env.IMAGE_NAME}")
withCredentials([string(credentialsId: 'CODACY_TARGETDB_API', variable: 'CODACY_PROJECT_TOKEN')]) {
sh "curl -L \"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-\$(uname -s)-\$(uname -m)\" -o docker-compose"
sh "chmod +x docker-compose"
sh "./docker-compose -f docker-compose-ci.yml up --exit-code-from web"
}
customImage.push()
}
}
}
在觸發器塊中,使用以下命令編輯projectPath
*/${sourceBranch}
它看起來應該像這樣:
bitbucketpr(projectPath:'*/${sourceBranch}',
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.