#!/usr/bin/env groovy​
package indyjenkinslib
// Load Jenkins shared libraries for all Hypeledger Indy project
def libIndy = [
remote: 'https://github.com/digital-me/indy-jenkins-lib.git',
branch: 'draft-01',
credentialsId: null,
]
try {
echo 'Trying to load shared libraries...'
library identifier: "libIndy@${libIndy.branch}", retriever: modernSCM(
[$class: 'GitSCMSource',
remote: libIndy.remote,
credentialsId: libIndy.credentialsId]
)
echo 'Shared library loaded'
} catch (error) {
echo "Could not load shared libraries: ${error.message}"
currentBuild.result = 'FAILURE'
return
}
// Initialize configuration
def config = initConfig()
if (!config) {
// Fail config is empty
currentBuild.result = 'FAILURE'
return
}
// CI Pipeline
stageCompile(config)
stageTest(config)
stagePackage(config)
// CD Pipeline
if (config.extended) {
stageRelease(config)
stageDelivery(config)
stageNotify(config)
}