Reputation: 312
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
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']]]) } } } } } }
Upvotes: 1
Views: 476
Reputation: 13712
Use changelog: false
to disable changelog generation, more detail
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 scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'some.client.id', url: 'https://somegithuburl.git']]], changelog: false, poll: false
}
}
}
}
}
}
Upvotes: 1