forked from baron/baron-sso
restart policy 정리
This commit is contained in:
@@ -62,12 +62,17 @@ for workflow in "$staging_pull"; do
|
||||
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 }}'
|
||||
assert_contains "$workflow" 'STAGING_PUBLIC_HEALTH_URL=${{ vars.STAGING_PUBLIC_HEALTH_URL }}'
|
||||
assert_contains "$workflow" 'STAGING_PUBLIC_HEALTH_MAX_ATTEMPTS=${{ vars.STAGING_PUBLIC_HEALTH_MAX_ATTEMPTS }}'
|
||||
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 "$staging_pull" 'docker compose -f staging_pull_compose.yaml up -d --remove-orphans --renew-anon-volumes'
|
||||
assert_contains "$staging_pull" 'check_container_http baron_gateway 5000'
|
||||
assert_contains "$staging_pull" 'check_public_http "${STAGING_PUBLIC_HEALTH_URL}"'
|
||||
assert_contains "$staging_pull" 'curl -fsS --max-time 10 "${url}"'
|
||||
|
||||
assert_contains "$userfront_dockerfile" "FROM ghcr.io/cirruslabs/flutter:3.38.0 AS build"
|
||||
assert_contains "$userfront_dockerfile" "RUN flutter build web --release --wasm"
|
||||
|
||||
56
test/staging_pull_restart_policy_test.sh
Normal file
56
test/staging_pull_restart_policy_test.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
compose_file="docker/staging_pull_compose.template.yaml"
|
||||
|
||||
if [ ! -f "$compose_file" ]; then
|
||||
echo "missing expected file: $compose_file" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
assert_service_has_restart_policy() {
|
||||
service="$1"
|
||||
awk -v service="$service" '
|
||||
$0 ~ "^ " service ":" {
|
||||
in_service = 1
|
||||
found = 0
|
||||
next
|
||||
}
|
||||
in_service && /^ [A-Za-z0-9_-]+:/ {
|
||||
exit found ? 0 : 1
|
||||
}
|
||||
in_service && /^[[:space:]]+restart:[[:space:]]+(always|unless-stopped)[[:space:]]*$/ {
|
||||
found = 1
|
||||
}
|
||||
END {
|
||||
if (in_service) {
|
||||
exit found ? 0 : 1
|
||||
}
|
||||
}
|
||||
' "$compose_file" || {
|
||||
echo "ERROR: long-running staging service must define restart: always or restart: unless-stopped: $service" >&2
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
for service in \
|
||||
postgres \
|
||||
clickhouse \
|
||||
redis \
|
||||
gateway \
|
||||
postgres_ory \
|
||||
kratos \
|
||||
hydra \
|
||||
keto \
|
||||
oathkeeper \
|
||||
ory_clickhouse \
|
||||
backend \
|
||||
adminfront \
|
||||
devfront \
|
||||
orgfront \
|
||||
userfront
|
||||
do
|
||||
assert_service_has_restart_policy "$service"
|
||||
done
|
||||
|
||||
echo "staging pull restart policy checks passed"
|
||||
Reference in New Issue
Block a user