forked from baron/baron-sso
레포 업데이트
This commit is contained in:
27
scripts/test_frontend_runtime_mode.sh
Normal file
27
scripts/test_frontend_runtime_mode.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
assert_mode() {
|
||||
script_path="$1"
|
||||
app_env="$2"
|
||||
expected="$3"
|
||||
actual="$(APP_ENV="$app_env" sh "$script_path" --print-mode)"
|
||||
if [ "$actual" != "$expected" ]; then
|
||||
echo "script=$script_path APP_ENV=$app_env expected mode=$expected got=$actual" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
for script in \
|
||||
"./adminfront/scripts/runtime-mode.sh" \
|
||||
"./devfront/scripts/runtime-mode.sh"
|
||||
do
|
||||
assert_mode "$script" "production" "production"
|
||||
assert_mode "$script" "prod" "production"
|
||||
assert_mode "$script" "stage" "production"
|
||||
assert_mode "$script" "staging" "production"
|
||||
assert_mode "$script" "development" "development"
|
||||
assert_mode "$script" "dev" "development"
|
||||
done
|
||||
|
||||
echo "frontend runtime mode checks passed"
|
||||
22
scripts/test_staging_workflow_env.sh
Normal file
22
scripts/test_staging_workflow_env.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
assert_contains() {
|
||||
file="$1"
|
||||
pattern="$2"
|
||||
if ! grep -Fq "$pattern" "$file"; then
|
||||
echo "missing pattern in $file: $pattern" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
for workflow in \
|
||||
".gitea/workflows/staging_code_pull.yml" \
|
||||
".gitea/workflows/staging_release.yml"
|
||||
do
|
||||
assert_contains "$workflow" "APP_ENV=stage"
|
||||
assert_contains "$workflow" "BACKEND_LOG_LEVEL=debug"
|
||||
assert_contains "$workflow" "CLIENT_LOG_DEBUG=true"
|
||||
done
|
||||
|
||||
echo "staging workflow env checks passed"
|
||||
Reference in New Issue
Block a user