I have a jenkins pipeline which checkouts the project repository from github to build the project in the build stage, in the next deploy stage we checkout another repository in github to read the configurations pertaining to deployment.
Since we checkout two times jenkins shows two workspaces along with two changes
- For the build changes of the actual project
- For the deploy changes of the deploy configuration repo
How can I limit the workspace and changes only to 1. For the build changes of the actual project ?
My pipeline looks something like below:
pipeline { agent any options { skipDefaultCheckout(true) } stages { stage('Build') { steps { checkout scm // build related tasks } } stage('Deploy') { when { branch "master" } steps { script { node("docker-ee") { script: checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'some.client.id', url: 'https://somegithuburl.git']]]) } } } } } }