Rafael
Rafael

Reputation: 91

Jenkins select changesets job for pipeline build

I'm trying to build a Jenkins Pipeline job.

My job is taking code from 2 repositories and doing some other stuff, on the end it should send email notification with changeset from first repository. Due to multiple SCM jobs it is saying that there are no changes.

How could I select to get changes from my first job?

Upvotes: 3

Views: 1155

Answers (1)

SegFault
SegFault

Reputation: 2200

After cloning the first repository you can insert in your pipeline a stage like this:

stage("Do stuff") {
  when{
    changeset "file.js"
  }
  steps {
    script {
      //do stuff
    }
  }
}

Other examples on https://pillsfromtheweb.blogspot.com/2020/07/execute-jenkins-pipeline-step-basing-on.html

Upvotes: 0

Related Questions