From fb9b234d89d85fd7eb3eb0e681f3a6711028fc5f Mon Sep 17 00:00:00 2001 From: Damian Smith Date: Mon, 16 Apr 2018 18:23:09 +0100 Subject: [PATCH] HMBFDGMA-2 start bringing in more useful scripts --- autobuild/synthesis/synthesis.gsh | 49 ++++++++++++------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/autobuild/synthesis/synthesis.gsh b/autobuild/synthesis/synthesis.gsh index ed8cada..9d793b7 100644 --- a/autobuild/synthesis/synthesis.gsh +++ b/autobuild/synthesis/synthesis.gsh @@ -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') {