forked from baron/baron-sso
devfront 구동 검증
This commit is contained in:
64
test/staging_frontend_deploy_policy_test.sh
Normal file
64
test/staging_frontend_deploy_policy_test.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
assert_not_contains() {
|
||||
file="$1"
|
||||
pattern="$2"
|
||||
if grep -Fq "$pattern" "$file"; then
|
||||
echo "forbidden pattern in $file: $pattern" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
staging_pull=".gitea/workflows/staging_code_pull.yml"
|
||||
pull_compose="docker/staging_pull_compose.template.yaml"
|
||||
devfront_vite="devfront/vite.config.ts"
|
||||
orgfront_vite="orgfront/vite.config.ts"
|
||||
|
||||
for file in \
|
||||
"$staging_pull" \
|
||||
"$pull_compose" \
|
||||
"$devfront_vite" \
|
||||
"$orgfront_vite"
|
||||
do
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "missing expected file: $file" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for workflow in "$staging_pull"; do
|
||||
assert_contains "$workflow" 'ADMINFRONT_URL=${{ vars.ADMINFRONT_URL }}'
|
||||
assert_contains "$workflow" 'DEVFRONT_URL=${{ vars.DEVFRONT_URL }}'
|
||||
assert_contains "$workflow" 'ORGFRONT_URL=${{ vars.ORGFRONT_URL }}'
|
||||
assert_contains "$workflow" 'KRATOS_ALLOWED_RETURN_URLS_JSON=${{ vars.KRATOS_ALLOWED_RETURN_URLS_JSON }}'
|
||||
assert_contains "$workflow" 'KRATOS_ALLOWED_RETURN_URLS_EXTRA=${{ vars.KRATOS_ALLOWED_RETURN_URLS_EXTRA }}'
|
||||
done
|
||||
|
||||
assert_contains "$staging_pull" 'bash scripts/render_ory_config.sh'
|
||||
assert_contains "$staging_pull" 'chmod -R 777 config/.generated/ory'
|
||||
assert_contains "$staging_pull" 'docker compose -f staging_pull_compose.yaml build --pull'
|
||||
|
||||
assert_contains "$pull_compose" "baron_devfront"
|
||||
assert_contains "$pull_compose" "baron_orgfront"
|
||||
assert_contains "$pull_compose" "http://127.0.0.1:5173/"
|
||||
assert_contains "$pull_compose" "http://127.0.0.1:5175/"
|
||||
|
||||
assert_contains "$devfront_vite" "/tmp/baron-sso-devfront-dist"
|
||||
assert_contains "$devfront_vite" "/tmp/baron-sso-devfront-vite-cache"
|
||||
assert_contains "$devfront_vite" "hostFromUrl(process.env.DEVFRONT_URL)"
|
||||
assert_contains "$devfront_vite" "process.env.DEVFRONT_ALLOWED_HOSTS"
|
||||
assert_contains "$orgfront_vite" "/tmp/baron-sso-orgfront-dist"
|
||||
assert_contains "$orgfront_vite" "/tmp/baron-sso-orgfront-vite-cache"
|
||||
assert_contains "$orgfront_vite" '"sorg.hmac.kr"'
|
||||
|
||||
echo "staging frontend deploy policy checks passed"
|
||||
Reference in New Issue
Block a user