Jenkinsfile and different strategies for branches

前端 未结 7 1818
星月不相逢
星月不相逢 2021-01-31 03:23

I\'m trying to use Jenkins file for all our builds in Jenkins, and I have following problem. We basically have 3 kind of builds:

  • pull-request build - it will be me
7条回答
  •  忘掉有多难
    2021-01-31 03:45

    Using this post, this worked for me:

            stage('...') {
                when {
                    expression { env.BRANCH_NAME == 'master' }
                }
                steps {
                    ...
                }
            }
    
    

提交回复
热议问题