HMBFDGMA-2 start bringing in more useful scripts

This commit is contained in:
Damian Smith 2018-04-16 18:23:09 +01:00
commit fb9b234d89

View file

@ -4,14 +4,27 @@ pipeline {
TOP = "top"
}
stages {
stage('Conditionally clean workspace') {
stage('Initial setup') {
steps {
script {
COMMON_SCRIPTS = "${WORKSPACE}/Common_scripts"
configurationhelper = load("${COMMON_SCRIPTS}/configuration/configuration.gsh")
githelper = load("${COMMON_SCRIPTS}/versioncontrol/git.gsh")
configurationhelper.registerPipelineScriptConfiguration()
}
}
}
stage('Clean workspace') {
when {
expression {
"${CLEAN_WORKSPACE}" == "true"
}
}
steps {
// Save any script files that were loaded into the workspace at first and are required after cleaning the workspace
stash allowEmpty: true, includes: 'Common_scripts/**/*', name: 'Clean workspace stash', useDefaultExcludes: false
cleanWs()
unstash name: 'Clean workspace stash'
}
}
stage('Selective clean') {
@ -23,36 +36,10 @@ pipeline {
}
stage('Checkout main Repo source') {
steps {
checkout([$class: 'GitSCM',
branches: [
[name: "${SOURCE_BRANCH}"]
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CleanBeforeCheckout'
],
[$class: 'CloneOption',
depth: 0,
noTags: false,
reference: "${REPO_ROOT}/${REPO_REF}",
shallow: false, timeout: 60
],
[$class: 'CheckoutOption',
timeout: 60
],
[$class: 'RelativeTargetDirectory',
relativeTargetDir: 'el'
]
],
submoduleCfg: [],
userRemoteConfigs: [
[url: "${SOURCE_REPO}"
]
]
])
script {
env.APPFOLDER = "${WORKSPACE}/el"
}
SOURCEDIR = "${WORKSPACE}/el"
SOURCEROOTDIR = 'el'
configurationhelper.gitCheckoutAndRegister('el', SOURCE_REPO, SOURCE_BRANCH, SOURCEDIR, SOURCEROOTDIR)
env.APPFOLDER = SOURCEDIR
}
}
stage('Set Project Variables') {