forked from baron/baron-sso
조직도 표현 개선
This commit is contained in:
35
test/gateway_userfront_residue_policy_test.sh
Normal file
35
test/gateway_userfront_residue_policy_test.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
deploy_gateway="deploy/templates/gateway/nginx.conf"
|
||||
|
||||
if [ ! -f "$deploy_gateway" ]; then
|
||||
echo "missing expected file: $deploy_gateway" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
assert_contains "$deploy_gateway" "root /usr/share/nginx/html;"
|
||||
assert_contains "$deploy_gateway" 'try_files $uri $uri/ /index.html;'
|
||||
assert_not_contains "$deploy_gateway" "baron_userfront"
|
||||
assert_not_contains "$deploy_gateway" "userfront_upstream"
|
||||
assert_not_contains "$deploy_gateway" "proxy_pass http://baron_userfront"
|
||||
|
||||
echo "gateway userfront residue policy checks passed"
|
||||
@@ -22,6 +22,7 @@ assert_not_contains() {
|
||||
staging_pull=".gitea/workflows/staging_code_pull.yml"
|
||||
pull_compose="docker/staging_pull_compose.template.yaml"
|
||||
deploy_compose="deploy/templates/docker-compose.yaml"
|
||||
deploy_gateway="deploy/templates/gateway/nginx.conf"
|
||||
userfront_dockerfile="userfront/Dockerfile"
|
||||
devfront_vite="devfront/vite.config.ts"
|
||||
orgfront_vite="orgfront/vite.config.ts"
|
||||
@@ -34,6 +35,7 @@ for file in \
|
||||
"$staging_pull" \
|
||||
"$pull_compose" \
|
||||
"$deploy_compose" \
|
||||
"$deploy_gateway" \
|
||||
"$userfront_dockerfile" \
|
||||
"$adminfront_vite" \
|
||||
"$devfront_vite" \
|
||||
@@ -82,6 +84,11 @@ assert_contains "$pull_compose" 'APP_ENV=${APP_ENV:-stage}'
|
||||
|
||||
assert_contains "$deploy_compose" "sh ./scripts/runtime-mode.sh"
|
||||
assert_not_contains "$deploy_compose" "command: npm run dev"
|
||||
assert_contains "$deploy_gateway" "root /usr/share/nginx/html;"
|
||||
assert_contains "$deploy_gateway" 'try_files $uri $uri/ /index.html;'
|
||||
assert_not_contains "$deploy_gateway" "baron_userfront"
|
||||
assert_not_contains "$deploy_gateway" "userfront_upstream"
|
||||
assert_not_contains "$deploy_gateway" "proxy_pass http://baron_userfront"
|
||||
|
||||
for app in adminfront devfront orgfront; do
|
||||
assert_contains ".gitea/workflows/build_RC.yml" "Build and push $app RC image"
|
||||
|
||||
Reference in New Issue
Block a user