Using a Jenkins pipeline to checkout multiple git repos into same job

后端 未结 4 913
日久生厌
日久生厌 2020-11-28 22:59

I\'m using the Jenkins Multiple SCM plugin to check out three git repositories into three sub directories in my Jenkins job. I then execute one set of commands to build a si

4条回答
  •  情话喂你
    2020-11-28 23:44

    You can use the dir command to execute a pipeline step in a subdirectory:

    node('ATLAS && Linux') {
        dir('CalibrationResults') {
            git url: 'https://github.com/AtlasBID/CalibrationResults.git'
        }
        dir('Combination') {
            git url: 'https://github.com/AtlasBID/Combination.git'
        }
        dir('CombinationBuilder') {
            git url: 'https://github.com/AtlasBID/CombinationBuilder.git'
        }
    
        sh('ls')
        sh('. CombinationBuilder/build.sh')
    }
    

提交回复
热议问题