This commit is contained in:
@@ -50,16 +50,26 @@ PY
|
|||||||
echo "[smoke] healthz check: ${BASE_URL}/healthz"
|
echo "[smoke] healthz check: ${BASE_URL}/healthz"
|
||||||
curl -fsS "${BASE_URL}/healthz" >/dev/null || { SMOKE_FAIL_MESSAGE="healthz check failed" fail "healthz check failed"; }
|
curl -fsS "${BASE_URL}/healthz" >/dev/null || { SMOKE_FAIL_MESSAGE="healthz check failed" fail "healthz check failed"; }
|
||||||
|
|
||||||
|
ENV_FILE="${ENV_FILE:-/etc/wpp/staging.env}"
|
||||||
|
|
||||||
|
run_manage() {
|
||||||
|
local cmd="$1"
|
||||||
|
(
|
||||||
|
cd "${APP_DIR}"
|
||||||
|
if [[ -f "${ENV_FILE}" ]]; then
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source "${ENV_FILE}"
|
||||||
|
set +a
|
||||||
|
fi
|
||||||
|
.venv/bin/python manage.py ${cmd}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
echo "[smoke] migration consistency check"
|
echo "[smoke] migration consistency check"
|
||||||
(
|
run_manage "migrate --check --noinput" || { SMOKE_FAIL_MESSAGE="schema drift: unapplied migrations in staging" fail "schema drift: unapplied migrations in staging"; }
|
||||||
cd "${APP_DIR}"
|
|
||||||
.venv/bin/python manage.py migrate --check --noinput
|
|
||||||
) || { SMOKE_FAIL_MESSAGE="schema drift: unapplied migrations in staging" fail "schema drift: unapplied migrations in staging"; }
|
|
||||||
|
|
||||||
echo "[smoke] gameplay flow via management command"
|
echo "[smoke] gameplay flow via management command"
|
||||||
(
|
run_manage "smoke_staging" || { SMOKE_FAIL_MESSAGE="manage.py smoke_staging failed" fail "manage.py smoke_staging failed"; }
|
||||||
cd "${APP_DIR}"
|
|
||||||
.venv/bin/python manage.py smoke_staging
|
|
||||||
) || { SMOKE_FAIL_MESSAGE="manage.py smoke_staging failed" fail "manage.py smoke_staging failed"; }
|
|
||||||
|
|
||||||
echo "[smoke] OK"
|
echo "[smoke] OK"
|
||||||
|
|||||||
Reference in New Issue
Block a user