adds option to disable deployment backup on remote
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
deployment_exclude_file=
|
||||
local_directory_path=
|
||||
now="$(date +%Y-%m-%d-%H-%M-%S)"
|
||||
remote_deployment_path=
|
||||
@@ -5,3 +6,4 @@ remote_directory_path=
|
||||
remote_ssh_string=
|
||||
remote_wp_path=
|
||||
remote_is_docker=
|
||||
do_backup=yes
|
||||
|
||||
Reference in New Issue
Block a user