firmware_tools/autobuilder.groovy
2018-11-19 10:52:04 +00:00

54 lines
1.5 KiB
Groovy

// Assume that WORKSPACE environment variable is set
autobuildroot = "${WORKSPACE}/autobuild"
commonscriptsroot = "${autobuildroot}/Common_scripts"
def conditionalclean(doclean = "${CLEAN_WORKSPACE}" == "true") {
if (doclean) {
echo "Cleaning workspace"
// Save any script files that were loaded into the workspace at first and are required after cleaning the workspace
stash allowEmpty: true, includes: 'autobuild/**', name: 'Clean workspace stash', useDefaultExcludes: false
cleanWs()
unstash name: 'Clean workspace stash'
}
else {
echo "Not cleaning workspace"
}
}
def commonscripts() {
return commonscriptsroot
}
def getautobuildpath() {
return autobuildroot
}
// Start up boilderplate
def start(productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, autobuildpath = autobuildroot, commonscriptspath = commonscriptsroot) {
echo "Starting...."
autobuildroot = autobuildpath
commonscriptsroot = commonscriptspath
conditionalclean()
def metafolder = load("${commonscripts()}/meta/folder.groovy")
metafolder.metareset()
def productinfo = load("${commonscripts()}/product/info.groovy")
productinfo.setname(productname, subcomponentname, jirakey)
def ch = load("${commonscripts()}/configuration/configuration.groovy")
ch.registerPipelineScriptConfiguration()
}
def configurationhelper() {
return load("${commonscripts()}/configuration/configuration.groovy")
}
// Everyone wants to know this
autobuilder = this
return this;