adds option to disable deployment backup on remote
This commit is contained in:
@@ -14,19 +14,20 @@ fi
|
|||||||
# shellcheck source=./deployment/deployment-example.env
|
# shellcheck source=./deployment/deployment-example.env
|
||||||
. "${1}"
|
. "${1}"
|
||||||
|
|
||||||
|
if [ "${do_backup}" = "yes" ]; then
|
||||||
if ssh ${remote_ssh_string} "mkdir --parents ${remote_deployment_directory_path}"; 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
|
||||||
if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 1 --path=${remote_wp_path}"; then
|
if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 1 --path=${remote_wp_path}"; then
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user