fix(staging): refresh dual-host edge verification
This commit is contained in:
@@ -177,6 +177,7 @@ trap rollback ERR
|
||||
|
||||
switched=true
|
||||
"${compose[@]}" up -d --no-build --remove-orphans
|
||||
"${compose[@]}" up -d --no-build --force-recreate --no-deps caddy
|
||||
|
||||
verify_container_image() {
|
||||
local service="$1"
|
||||
@@ -202,8 +203,10 @@ let observed = {};
|
||||
for (let attempt = 1; attempt <= 12; attempt += 1) {
|
||||
try {
|
||||
const login = await fetch(`${process.env.STAGING_URL}/login`);
|
||||
const adminPage = await fetch(`${process.env.STAGING_URL}/admin`, { redirect: "manual" });
|
||||
const adminApi = await fetch(`${process.env.STAGING_URL}/api/admin/session`);
|
||||
const userAdminPage = await fetch(`${process.env.STAGING_URL}/admin`, { redirect: "manual" });
|
||||
const userAdminApi = await fetch(`${process.env.STAGING_URL}/api/admin/session`);
|
||||
const adminPage = await fetch(`${process.env.ADMIN_USER_ORIGIN}/admin`, { redirect: "manual" });
|
||||
const adminApi = await fetch(`${process.env.ADMIN_USER_ORIGIN}/api/admin/session`);
|
||||
const account = await fetch(`${process.env.STAGING_URL}/api/account`);
|
||||
const publicHealth = await fetch(`${process.env.STAGING_URL}/api/health`);
|
||||
const publicBody = await publicHealth.json();
|
||||
@@ -212,6 +215,8 @@ for (let attempt = 1; attempt <= 12; attempt += 1) {
|
||||
observed = {
|
||||
attempt,
|
||||
login: login.status,
|
||||
userAdminPage: userAdminPage.status,
|
||||
userAdminApi: userAdminApi.status,
|
||||
adminPage: adminPage.status,
|
||||
adminLocation: adminPage.headers.get("location"),
|
||||
adminApi: adminApi.status,
|
||||
@@ -224,6 +229,8 @@ for (let attempt = 1; attempt <= 12; attempt += 1) {
|
||||
};
|
||||
if (
|
||||
login.ok
|
||||
&& userAdminPage.status === 404
|
||||
&& userAdminApi.status === 404
|
||||
&& adminPage.status === 307
|
||||
&& adminPage.headers.get("location") === "/login"
|
||||
&& adminApi.status === 401
|
||||
|
||||
Reference in New Issue
Block a user