From 2fb8abfaa25ec46ca33f3848c0a9753458ba840e Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Mon, 13 Jan 2020 15:12:25 +0100 Subject: [PATCH] when the resume option is selected, the local repo won't be deleted #18304 --- Jenkinsfile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa6afd1..69de8e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -165,17 +165,19 @@ pipeline { stage('initialize local repository') { steps { sh ''' - echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}" - echo "CLEANUP_GCUBE_REPO: ${CLEANUP_GCUBE_REPO}" - if [ "$CLEANUP_GCUBE_REPO" = "true" ]; then - echo "Remove gCube artifacts from local repository" - rm -rf $MAVEN_LOCAL_REPO/org/gcube - fi - if [ "$REMOVE_LOCAL_REPO" = "true" ]; then - echo "Create a fresh local repository" - rm -rf $MAVEN_LOCAL_REPO - mkdir -p $MAVEN_LOCAL_REPO - fi + if [ "$RESUME" = "false" ]; then + echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}" + echo "CLEANUP_GCUBE_REPO: ${CLEANUP_GCUBE_REPO}" + if [ "$CLEANUP_GCUBE_REPO" = "true" ]; then + echo "Remove gCube artifacts from local repository" + rm -rf $MAVEN_LOCAL_REPO/org/gcube + fi + if [ "$REMOVE_LOCAL_REPO" = "true" ]; then + echo "Create a fresh local repository" + rm -rf $MAVEN_LOCAL_REPO + mkdir -p $MAVEN_LOCAL_REPO + fi + fi mv "${AGENT_ROOT_FOLDER}/settings.xml" "${AGENT_ROOT_FOLDER}/settings.${PIPELINE_BUILD_NUMBER}" cp "${AGENT_ROOT_FOLDER}/${MAVEN_SETTINGS_FILE}" "${AGENT_ROOT_FOLDER}/settings.xml" echo "Done with local repository and settings"