Jenkins stage not triggered even if changeset is correct

Viewed 139

My jenkins file looks something like this:

options {
    skipDefaultCheckout()
}
stages{
    stage("Unit Test"){
        when {
            allOf{
                expression {params.REPOSITORY_CREDENTIALS != null && params.TRG_BRANCH != null}
                anyOf {
                    changeset pattern: "([a-zA-Z]*_cli|clarity_xml_tools)\\/.*", comparator: "REGEX"
                    changeset pattern: "jenkins\\/pipeline_scripts\\/.*", comparator: "REGEX"
                }
            }
        }
        steps{   
            container('omics-build-agent'){
                echo "Stage triggered.."
            }
        }
        post{
            always{
                echo "Stage completed.."
            }
            success{
                echo "Unit Test completed successfully.."
            }
            failure{
                echo "Unit Test Failed!!"
            }
        }
    }

I checked the Changes in my jenkins build info:

jenkins/pipeline_scripts/build-Build_Python-clarity_xml_tools.sh

But my stage is still not getting triggered. What am I missing?

Note: I cannot remove skipDefaultCheckout() because I have 2 different repos who should be triggering my job when changes are pushed and they should be checked out to 2 different sub folders.

So my pipeline gets triggered by the Generic Webhook Plugin (which is working fine) from either of the 2 repo. So I had to force stop the default checkout and then use the checkout plugin for gitSCM to get my repos inside the stage.

Could it be because of this?

0 Answers
Related