Martin Dimitrov 8f75081e6b
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 30s
Build and push Doorman UI / API / docker (push) Successful in 3m42s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 5s
add staging deployment + test to gitea workflow
2025-06-08 19:00:49 -07:00

22 lines
793 B
TypeScript

export const baseUrl = process.env.STAGE == "staging" ? "https://doorman-6741-staging.twil.io": "http://localhost:8080";
export const buzzerUrl = process.env.STAGE == "staging" ? "https://buzzer-2439-staging.twil.io/buzzer-activated": "http://localhost:4500/buzzer-activated";
export const doorName = "test";
export const buzzerNumber = "6133163433";
export const key = "1234";
console.log("using URL", baseUrl, buzzerUrl);
export const waitForService = async (url: string, timeout = 30000) => {
const start = Date.now();
while (Date.now() - start < timeout) {
try {
await fetch(url);
return true;
} catch (err) {
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
throw new Error(`Service at ${url} did not start within ${timeout}ms`);
};