Umesh Tyagi
Umesh Tyagi

Reputation: 141

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

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?

Upvotes: 1

Views: 2591

Answers (1)

Tristate
Tristate

Reputation: 1821

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

Upvotes: 2

Related Questions