Kontroly prerekvizit do knihovny
This commit is contained in:
parent
f6d939fc31
commit
0458abb419
3 changed files with 22 additions and 22 deletions
13
make/deploy
13
make/deploy
|
@ -3,17 +3,8 @@
|
||||||
set -exuo pipefail
|
set -exuo pipefail
|
||||||
. make/lib.sh
|
. make/lib.sh
|
||||||
|
|
||||||
if test "$USER" != "mam-web";
|
gimli_only
|
||||||
then
|
only_in_directory "$TESTWEB"
|
||||||
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)"
|
CURRENT_BRANCH="$(git branch --show-current)"
|
||||||
BRANCH="${1:-$CURRENT_BRANCH}"
|
BRANCH="${1:-$CURRENT_BRANCH}"
|
||||||
|
|
|
@ -3,17 +3,8 @@
|
||||||
set -exuo pipefail
|
set -exuo pipefail
|
||||||
. make/lib.sh
|
. make/lib.sh
|
||||||
|
|
||||||
if test "$USER" != "mam-web"
|
gimli_only
|
||||||
then
|
only_in_directory "$PRODWEB"
|
||||||
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)"
|
CURRENT_BRANCH="$(git branch --show-current)"
|
||||||
BRANCH="${1:-$CURRENT_BRANCH}"
|
BRANCH="${1:-$CURRENT_BRANCH}"
|
||||||
|
|
18
make/lib.sh
18
make/lib.sh
|
@ -26,6 +26,24 @@ function ensure_venv {
|
||||||
. "$VENV_PATH/bin/activate"
|
. "$VENV_PATH/bin/activate"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gimli_only {
|
||||||
|
# Rovnou zkontrolujeme i uživatele
|
||||||
|
if test "$HOSTNAME" != gimli -o "$USER" != mam-web
|
||||||
|
then
|
||||||
|
echo "Tento příkaz se má spouštět na gimlim, chceš pokračovat? Pokud ne, sestřel tento skript."
|
||||||
|
read
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function only_in_directory {
|
||||||
|
DIR="$1"
|
||||||
|
CURRENT="$(readlink -f .)"
|
||||||
|
if test "$CURRENT" != "$DIR"
|
||||||
|
then
|
||||||
|
echo "Tento příkaz se má spouštět ve složce $DIR, chceš pokračovat? Pokud ne, sestřel tento skript."
|
||||||
|
read
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function safe_checkout_branch {
|
function safe_checkout_branch {
|
||||||
if "$#" -ne 2
|
if "$#" -ne 2
|
||||||
|
|
Loading…
Reference in a new issue