paul58914080
paul58914080

Reputation: 312

how to not show 2 workspace and changes in jenkins?

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']]])
            }
          }
        }
      }
    }
}

Upvotes: 1

Views: 476

Answers (1)

yong
yong

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

Related Questions