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

14
Jenkinsfile vendored
View File

@ -82,12 +82,16 @@ pipeline {
} }
sh ''' sh '''
echo "cleanup $DEPLOY_FILE"; echo "cleanup $DEPLOY_FILE";
if [ -f ${BACKUP_FILE} ]; then if [ -f ${DEPLOY_FILE} ]; then
echo "backup found: ${BACKUP_FILE} going to replace it"; if [ -f ${BACKUP_FILE} ]; then
rm ${BACKUP_FILE}; 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 fi
mv ${DEPLOY_FILE} ${BACKUP_FILE};
rm ${DEPLOY_FILE};
''' '''
} }
} }