简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM