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') { stage('initialize local repository') {
steps { steps {
sh ''' sh '''
echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}" if [ "$RESUME" = "false" ]; then
echo "CLEANUP_GCUBE_REPO: ${CLEANUP_GCUBE_REPO}" echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}"
if [ "$CLEANUP_GCUBE_REPO" = "true" ]; then echo "CLEANUP_GCUBE_REPO: ${CLEANUP_GCUBE_REPO}"
echo "Remove gCube artifacts from local repository" if [ "$CLEANUP_GCUBE_REPO" = "true" ]; then
rm -rf $MAVEN_LOCAL_REPO/org/gcube echo "Remove gCube artifacts from local repository"
fi rm -rf $MAVEN_LOCAL_REPO/org/gcube
if [ "$REMOVE_LOCAL_REPO" = "true" ]; then fi
echo "Create a fresh local repository" if [ "$REMOVE_LOCAL_REPO" = "true" ]; then
rm -rf $MAVEN_LOCAL_REPO echo "Create a fresh local repository"
mkdir -p $MAVEN_LOCAL_REPO rm -rf $MAVEN_LOCAL_REPO
fi mkdir -p $MAVEN_LOCAL_REPO
fi
fi
mv "${AGENT_ROOT_FOLDER}/settings.xml" "${AGENT_ROOT_FOLDER}/settings.${PIPELINE_BUILD_NUMBER}" 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" cp "${AGENT_ROOT_FOLDER}/${MAVEN_SETTINGS_FILE}" "${AGENT_ROOT_FOLDER}/settings.xml"
echo "Done with local repository and settings" echo "Done with local repository and settings"