Explorar el Código

adds option to disable deployment backup on remote

test
Jean-Christophe Vanhalle hace 2 años
padre
commit
a48fa2525f
Se han modificado 2 ficheros con 15 adiciones y 12 borrados
  1. 13
    12
      deploy-directory-to-remote.sh
  2. 2
    0
      deployment/deployment-example.env

+ 13
- 12
deploy-directory-to-remote.sh Ver fichero

@@ -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

+ 2
- 0
deployment/deployment-example.env Ver fichero

@@ -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

Cargando…
Cancelar
Guardar