From 1b642328ec138422948d12c072cc5bed38a33e5f Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Fri, 11 Oct 2019 09:14:17 -0400 Subject: [PATCH] New parameter to wipe out the gcube artifacts before the builds. --- Jenkinsfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2627df0..3c35df5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,6 +76,8 @@ pipeline { GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}" PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}" CLEANUP_LOCAL_REPO = "${params.cleanup_local_repo}" + CLEANUP_GCUBE_REPO = "${params.cleanup_gcube_artifacts}" + } // see https://jenkins.io/doc/book/pipeline/syntax/#parameters @@ -88,9 +90,13 @@ pipeline { defaultValue: 'x.y.z', description: 'The number of the gCube release to build. Sample values: 4.14, 4.15, etc.') + booleanParam(name: 'cleanup_gcube_artifacts', + defaultValue: true, + description: 'Wipe out the gcube artifacts from the local maven repository before the builds?') + booleanParam(name: 'cleanup_local_repo', defaultValue: true, - description: 'Whether the local maven repository needs to be wiped out before the builds.') + description: 'Wipe out the local maven repository before the builds?') } //see https://jenkins.io/doc/book/pipeline/syntax/#stages @@ -98,6 +104,10 @@ pipeline { stage('clean up before starting') { steps { sh ''' + if [ "$CLEANUP_GCUBE_REPO" = "true" ]; then + echo "REmove gCube artifacts from local repository" + rm -rf $MAVEN_LOCAL_REPO/org/gcube + fi if [ "$CLEANUP_LOCAL_REPO" = "true" ]; then echo "Create a fresh local repository" rm -rf $MAVEN_LOCAL_REPO