How to run jenkins job via changes in specific git folder?

Viewed 352

I have one git repository where I have multiple folders, I want the Jenkins pipeline trigger when a specific folder gets changed.

How can I achieve this?

1 Answers

You can configure your Jenkinsfile to do that.

Take a look on Jenkins Built-in Conditions. You need "changeset" here.

e.g.

stages {
stage('yourStage') {
    when { changeset "FOLDERNAME/*"}
    steps {
     //.... what to do...
    }
}

}

Jenkins Built In Conditions

Related