Jenkinsfile with two git repositories

前端 未结 2 1765
囚心锁ツ
囚心锁ツ 2020-12-15 05:48

I\'m using the Jenkins pipeline plugin with a Jenkinsfile.

In one repository, called vms.git, I have the Jenkinsfile and an application it builds.

I have a

2条回答
  •  误落风尘
    2020-12-15 06:29

    Another elegant solution for handling multiple Git repositories within single pipeline can be found at this thread.

    node {
        dir('RepoOne') {
            git url: 'https://github.com/somewhere/RepoOne.git'
        }
        dir('RepoTwo') {
            git url: 'https://github.com/somewhere/RepoTwo.git'
        }
    
        sh('. RepoOne/build.sh')
        sh('. RepoTwo/build.sh')
    }
    

提交回复
热议问题