Pavel "LEdoian" Turinsky
2 years ago
4 changed files with 95 additions and 35 deletions
@ -1,3 +1,25 @@ |
|||
#!/bin/bash |
|||
|
|||
set -exuo pipefail |
|||
. make/lib.sh |
|||
|
|||
if test "$USER" != "mam-web"; |
|||
then |
|||
echo >&2 "Nasadit web smí jen uživatel mam-web" |
|||
exit 1 |
|||
fi |
|||
|
|||
if test "$(readlink -f .)" != "$TESTWEB"; |
|||
then |
|||
echo >&2 "Nasadit testweb lze jen v jeho složce" |
|||
exit 1 |
|||
fi |
|||
|
|||
CURRENT_BRANCH="$(git branch --show-current)" |
|||
BRANCH="${1:-$CURRENT_BRANCH}" |
|||
|
|||
safe_checkout_branch "$BRANCH" "$0" |
|||
|
|||
# Teď máme správnou větev, jdeme vše nainstalovat |
|||
install_everything |
|||
systemctl --user restart mamweb-test.service |
|||
|
@ -1,3 +1,34 @@ |
|||
#!/bin/bash |
|||
|
|||
set -exuo pipefail |
|||
. make/lib.sh |
|||
|
|||
if test "$USER" != "mam-web" |
|||
then |
|||
echo >&2 "Nasadit web smí jen uživatel mam-web" |
|||
exit 1 |
|||
fi |
|||
|
|||
if test "$(readlink -f .)" != "$PRODWEB" |
|||
then |
|||
echo >&2 "Nasadit testweb lze jen v jeho složce" |
|||
exit 1 |
|||
fi |
|||
|
|||
CURRENT_BRANCH="$(git branch --show-current)" |
|||
BRANCH="${1:-$CURRENT_BRANCH}" |
|||
|
|||
if test "$BRANCH" != master |
|||
then |
|||
echo "Pozor, nasazuješ na produkci větev, která není master ($BRANCH), chceš pokračovat? Pokud ne, sestřel tento skript." |
|||
read |
|||
fi |
|||
|
|||
# Záloha DB |
|||
( cd -P .. && ./backup_prod_db.sh ) |
|||
|
|||
safe_checkout_branch "$BRANCH" "$0" |
|||
|
|||
# Teď máme správnou větev, jdeme vše nainstalovat |
|||
install_everything |
|||
systemctl --user restart mamweb-prod.service |
|||
|
Loading…
Reference in new issue