pipeline { agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) } } } stage('Checkout dependencies') { steps { script { configurationhelper = autobuilder.configurationhelper() CCMURL = 'git@hydra:tools/ccm.git' CCMBRANCH = 'origin/master' CCMDIR = "${WORKSPACE}/ccm" configurationhelper.gitCheckoutAndRegister(meta, 'ccm', CCMURL, CCMBRANCH, CCMDIR) CCM = "${CCMDIR}/bin/CCM.exe" } } } stage('Checkout source') { steps { script { SOURCEDIR = "${WORKSPACE}/source" configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCE_REVISION, SOURCEDIR, '', 0, false) } } } stage("Clean exports") { steps { script { RESULTS = 'results' cleanfolders = [ RESULTS, ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) } } } stage('Static analysis') { steps { script { def ccmconfigurationfile = "${WORKSPACE}/ccm.xml" writeFile(file: ccmconfigurationfile, text: CCM_CONFIGURATION) echo "Configuration file: ${ccmconfigurationfile} contains:\n${CCM_CONFIGURATION}" dir(RESULTS) { echo "Executing: ${CCM} ${ccmconfigurationfile} > ccm.xml" if (isUnix()) { sh """#!/bin/bash ${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } else { echo "Executing: ${WINDOWS_COMMANDLINE_ENVIRONMENT} \"${CCM}\" \"${ccmconfigurationfile}\" > ccm.xml" bat """ ${WINDOWS_COMMANDLINE_ENVIRONMENT} "${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } } recordIssues(tools: [ ccm(pattern: "**/ccm.xml", reportEncoding: 'UTF-8'), ]) } } } } post { always { echo 'Post-build' } failure { echo 'Failed build' } unstable { echo 'Unstable build' } success { echo 'Succeeded build' } } }