I have a C# repo that has multiple Projects inside of a single solution. Each Project has their own Jenkinsfile
but they could share a Pipeline with another Project. Inside of their Jenkinsfile
it gives a subdirectory. I am trying to get it to where it will only continue through the Pipeline if there have been changes to a subdirectory.
stage ('Check Subdirectory for Change') {
when {
allOf {
expression {
config.Project.SubDirectory != ""
}
not { changeset config.Project.SubDirectory + '/**' }
}
}
steps {
script {
currentBuild.result = 'SUCCESS'
config.ContinueBuild = false
}
}
}
This is my current setup inside the pipeline. This will do the check and then skip the stage if there weren't any changes. The problem is that if there are no changes it will skip the Check Subdirectory for Change
stage and continue the build. I need it to exit the build inside and ONLY continue if there was changes to the subdirectory.