首页 > 解决方案 > Jenkinsfile 声明式管道:在阶段步骤中签出另一个 repo

问题描述

我的 Jenkinsfile 位于存储库“A”中,我要在存储库“B”中签出一个存储库。这样做的正确方法是什么?

这就是我目前的做法,但它不起作用:

    stage("Checkout my repo repo ") {
        steps {
            checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
                extensions: [[$class: 'RelativeTargetDirectory', 
            relativeTargetDir: 'copy-repo-here']],
                userRemoteConfigs: [[credentialsId: 'my-creds', 
                url: 'git@github.com:my-git-repo.git']]]) 
       }
}

任何帮助表示赞赏!

标签: jenkinsjenkins-pipeline

解决方案


推荐阅读