Is it impossible to checkout a different branch in Jenkinsfile?

前端 未结 5 2103
耶瑟儿~
耶瑟儿~ 2021-02-05 08:03

I have two branches on BitBucket: master and develop. I\'ve also got a BitBucket Team Folder job configured on my Jenkins server to build that reposito

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 08:30

    You can use the git command which is the less advanced version of the checkout command

    stage('Repo Checkout') {
                steps {
                    deleteDir()
                    dir("repo-one-master") {
                        git url: "ssh://git@host.com/folder/project",
                            branch: 'master'
                    }
                    dir("repo-one-feature) {
                        git url: "ssh://git@host.com/folder/project",
                            branch: 'some-branch'
                    }
                }
            }
    

提交回复
热议问题