1

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

  1. For the build changes of the actual project
  2. 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']]]) } } } } } } 
3
  • Please include information about how exactly you checkout the projects. Commented Jul 6, 2020 at 5:30
  • @MaratC I have updated the question. Thank you for looking into this. Commented Jul 6, 2020 at 5:44
  • I also tried looking at stackoverflow.com/questions/56731950/… which is somewhat similar to this issue Commented Jul 6, 2020 at 8:58

1 Answer 1

1

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 } } } } } } 
Sign up to request clarification or add additional context in comments.

2 Comments

I tried with changelog: false but it still results in changeset of the deploy stage. Also, I already have a global agent and I use a different node for deploy stage. I dont think dir does anything more in this case than working on a specific directory.
I am sorry, actually I had it in the wrong portion of the argument. Setting changelog: false indeed stopped it from showing in changes

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.