Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
def call(
    def COMPLIANCE_REPO_CREDENTIALS,
    def COMPLIANCE_REPO_URL,
    def RULESDIR,
    def TESTSUITENAME,
    def CONTINUEONFAIL
) {
    try {
        // Perform a 'git checkout' of a remote repository which is NOT the repository from which this pipeline code was sourced
        Git checkout COMPLIANCE_REPO_URL using COMPLIANCE_REPO_CREDENTIALS 

        // Executes the 'mettleci compliance test' command to test your repository's DataStage jobs against your Compliance rules.
        // Note that 'mettleci compliance test' is mnotnot the same as 'mettleci compliance query' - See the documentation for more details. 
        mettleci compliance test $RULESDIR $TESTSUITENAME

 Compliance Test - ${TESTSUITENAME}

     }
    finally {                                                         // Whether the above is successfult or not...
     Publish Unit Test resultsjunit astestResults "compliance_report_${TESTSUITENAME}.xml"    //  }Publish CCMT output as JUnit Test Results
            allowEmptyResults: true                                   // Don't fail the build on missing test result files or empty test results
            skipPublishingChecks: true                        catch(e) {       // Don't Publishautomatically Unitpublish Testtest results as "compliance_report_${TESTSUITENAME}.xml" to Git
            skipMarkingBuildUnstable: (CONTINUEONFAIL)              throw e // (Optionally) mark the build as #successful,even Propagateif errorthere forare downstreamtest errorfailures handlingreported
    }
}

Note that this Custom Step makes used of Jenkins' JUnit plugin.