Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

This Shared Library hosts a Custom Step which is an example implementation of the Compliance step of a MettleCI Pipeline. It provides parameterised set of steps which…

  • Checks out the specified Compliance repository

  • Invokes the MettleCI compliance test command test your repository's DataStage assets against your Compliance rules

  • Publishes the generated JUnit Compliance results back to your Jenkins Controller.

Here’s the pseudocode for the Shared Library:

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
        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 not the same as 'mettleci compliance query' - See the documentation for more details. 
        mettleci compliance test $RULESDIR $TESTSUITENAME

        junit testResults "compliance_report_${TESTSUITENAME}.xml"        # Publish Unit Test results 
    }
    catch(e) {
        junit testResults "compliance_report_${TESTSUITENAME}.xml"        # Publish Unit Test results
        throw e                                                           # Propagate error for downstream error handling
    }
}

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

  • No labels