when the resume option is selected, the local repo won't be deleted

#18304
This commit is contained in:
Roberto Cirillo 2020-01-13 15:12:25 +01:00
parent 43416769e3
commit 2fb8abfaa2
1 changed files with 13 additions and 11 deletions

24
Jenkinsfile vendored
View File

@ -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"