adds option to disable deployment backup on remote

This commit is contained in:
Jean-Christophe Vanhalle
2023-11-24 01:09:09 +01:00
parent bc14e41615
commit a48fa2525f
2 changed files with 15 additions and 12 deletions

View File

@@ -14,18 +14,19 @@ fi
# shellcheck source=./deployment/deployment-example.env
. "${1}"
if ssh ${remote_ssh_string} "mkdir --parents ${remote_deployment_directory_path}"; then
echo deployment folder successfully created on remote
else
echo deployment folder creation on remote failed
exit 1
fi
if ssh ${remote_ssh_string} "cp --archive --recursive ${remote_directory_path} ${remote_deployment_directory_path}/$(basename ${remote_directory_path}).backup.${now}"; then
echo backup of current remote directory successfully created on remote
else
echo backup of current remote directory failed
exit 1
if [ "${do_backup}" = "yes" ]; then
if ssh ${remote_ssh_string} "mkdir --parents ${remote_deployment_directory_path}"; then
echo deployment folder successfully created on remote
else
echo deployment folder creation on remote failed
exit 1
fi
if ssh ${remote_ssh_string} "cp --archive --recursive ${remote_directory_path} ${remote_deployment_directory_path}/$(basename ${remote_directory_path}).backup.${now}"; then
echo backup of current remote directory successfully created on remote
else
echo backup of current remote directory failed
exit 1
fi
fi
if [ "${remote_is_docker}" != "yes" ]; then