skipDefaultCheckout true选项将跳过所有阶段,并进入postActions阶段

时间:2020-08-03 10:50:49

标签: go jenkins gitlab jenkins-pipeline jenkins-plugins

我需要将代码签出到$ GOPATH / src / dev-DIR文件夹中。但是由于 skipDefaultCheckout true 选项,checkout scm和其他阶段未执行。直接发布操作正在执行,请帮助我哪里出问题了?

pipeline {
 agent {node {label 'project_a'}}
    options {
        skipDefaultCheckout true 
    }
     environment {
        PATH = "$PATH:/opt/jenkins/:/usr/local/go/bin/"
        GIT_REPO = get_gitrepo()
        GOPATH= "${env.WORKSPACE}"
        PROJECT_WORKSPACE = "${env.WORKSPACE}/src/dev-DIR"
    }
      stages {
        stage('checkout scm'){
            steps{
                dir ("${GOPATH}/src/dev-DIR"){
                    checkout scm
                }
            }
        }
         stage('Install Prerequisites') {
           // go get -t
        }
}
     post{
        //some actions
    }
}
    ```

0 个答案:

没有答案