Jenkins pipeline if else not working

后端 未结 3 422

I am creating a sample jenkins pipeline, here is the code.

pipeline {
    agent any 

    stages {    
        stage(\'test\') { 
            steps { 
                   


        
3条回答
  •  有刺的猬
    2021-01-30 05:52

            if ( params.build_deploy == '1' ) {
                println "build_deploy 是 ${params.build_deploy}"
                  jobB = build job: 'k8s-core-user_deploy', propagate: false, wait: true, parameters: [
                             string(name:'environment', value: "${params.environment}"),
                             string(name:'branch_name', value: "${params.branch_name}"),
                             string(name:'service_name', value: "${params.service_name}"),                      
                         ]
                println jobB.getResult()
            }
    

提交回复
热议问题