check on deploy file added

This commit is contained in:
Roberto Cirillo 2022-04-28 18:06:37 +02:00
parent 223b9ea7d6
commit 12c11d6047
1 changed files with 10 additions and 6 deletions

16
Jenkinsfile vendored
View File

@ -82,12 +82,16 @@ pipeline {
}
sh '''
echo "cleanup $DEPLOY_FILE";
if [ -f ${BACKUP_FILE} ]; then
echo "backup found: ${BACKUP_FILE} going to replace it";
rm ${BACKUP_FILE};
fi
mv ${DEPLOY_FILE} ${BACKUP_FILE};
rm ${DEPLOY_FILE};
if [ -f ${DEPLOY_FILE} ]; then
if [ -f ${BACKUP_FILE} ]; then
echo "backup found: ${BACKUP_FILE} going to replace it";
rm ${BACKUP_FILE};
fi
mv ${DEPLOY_FILE} ${BACKUP_FILE};
rm ${DEPLOY_FILE};
else
echo "deploy file empty"
fi
'''
}
}