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

View File

@@ -1,3 +1,4 @@
deployment_exclude_file=
local_directory_path= local_directory_path=
now="$(date +%Y-%m-%d-%H-%M-%S)" now="$(date +%Y-%m-%d-%H-%M-%S)"
remote_deployment_path= remote_deployment_path=
@@ -5,3 +6,4 @@ remote_directory_path=
remote_ssh_string= remote_ssh_string=
remote_wp_path= remote_wp_path=
remote_is_docker= remote_is_docker=
do_backup=yes