From ac9cb53185edf2c2ee29bea8bffece0d21015bc2 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sun, 20 Nov 2022 04:23:41 +0100 Subject: [PATCH] =?UTF-8?q?Hez=C4=8D=C3=AD=20SSH=20spojen=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Přidal jsem `set -euxo pipefail`, takže nejsou potřeba `&&` a obecně se to chová víc jako ostatní make skripty - Venv se zapíná stejně jako v lokálních skriptech, takže se dá jednoduše změnit jeho cesta --- make/push_compiled_vue_to_test | 9 +++++++-- make/sync_prod_flatpages | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/make/push_compiled_vue_to_test b/make/push_compiled_vue_to_test index f386ee86..99495a7b 100755 --- a/make/push_compiled_vue_to_test +++ b/make/push_compiled_vue_to_test @@ -5,5 +5,10 @@ set -exuo pipefail scp vue_frontend/webpack-stats.json "$GIMLI_LOGIN:$TESTWEB/vue_frontend/" rsync -ave ssh seminar/static/seminar/vue "$GIMLI_LOGIN:$TESTWEB/seminar/static/seminar/" -# TODO: Je OK tady zapínat venv přímo takhle, nebo by to taky mělo být enkapsulováno do nějakého skriptu (e.g. make/deploy/collect_static)? -ssh "$GIMLI_LOGIN" "cd $TESTWEB && . env/bin/activate && ./manage.py collectstatic --noinput" +ssh "$GIMLI_LOGIN" " + set -euxo pipefail + cd $TESTWEB + . make/lib.sh + ensure_venv + ./manage.py collectstatic --noinput + " diff --git a/make/sync_prod_flatpages b/make/sync_prod_flatpages index 76c31f1b..4d9d8e1f 100755 --- a/make/sync_prod_flatpages +++ b/make/sync_prod_flatpages @@ -7,8 +7,10 @@ ensure_venv # TODO: This is very ugly, will fix in a future PR (hopefully) ssh "$GIMLI_LOGIN" " + set -euxo pipefail cd $PRODWEB - . env/bin/activate + . make/lib.sh + ensure_venv ./manage.py dumpdata flatpages --indent=2 > flat.json ./fix_json.py flat.json flat_fixed.json "