adds an option to prevent running wp-cli when remote is running in a container

This commit is contained in:
Jean-Christophe Vanhalle
2023-11-20 00:41:25 +01:00
parent 77730f0873
commit bc14e41615
2 changed files with 15 additions and 10 deletions

View File

@@ -28,11 +28,13 @@ else
exit 1 exit 1
fi fi
if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 1 --path=${remote_wp_path}"; then if [ "${remote_is_docker}" != "yes" ]; then
echo maintenance mode activated if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 1 --path=${remote_wp_path}"; then
else echo maintenance mode activated
echo something went horribly wrong else
exit 1 echo something went horribly wrong
exit 1
fi
fi fi
if rsync --archive --compress --delete --delete-excluded --exclude-from="${deployment_exclude_file}" --human-readable --progress "${local_directory_path}/" "${remote_ssh_string}":"${remote_directory_path}"; then if rsync --archive --compress --delete --delete-excluded --exclude-from="${deployment_exclude_file}" --human-readable --progress "${local_directory_path}/" "${remote_ssh_string}":"${remote_directory_path}"; then
@@ -42,9 +44,11 @@ else
exit 1 exit 1
fi fi
if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 0 --path=${remote_wp_path}"; then if [ "${remote_is_docker}" != "yes" ]; then
echo maintenance mode deactivated if ssh ${remote_ssh_string} "wp option patch update wpmm_settings general status 0 --path=${remote_wp_path}"; then
else echo maintenance mode deactivated
echo something went horribly wrong else
exit 1 echo something went horribly wrong
exit 1
fi
fi fi

View File

@@ -4,3 +4,4 @@ remote_deployment_path=
remote_directory_path= remote_directory_path=
remote_ssh_string= remote_ssh_string=
remote_wp_path= remote_wp_path=
remote_is_docker=