@faable/faable 1.5.24 → 1.5.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -67,6 +67,33 @@ const deploy = {
|
|
|
67
67
|
const dashboard_url = `https://dashboard.faable.com/deploy/${app.team}/app/${app.id}`;
|
|
68
68
|
log.info(`🌍 Deployment created (${deployment.id}) -> https://${app.url}`);
|
|
69
69
|
log.info(`📊 View it in the dashboard -> ${dashboard_url}`);
|
|
70
|
+
// Wait (up to 5 minutes) for the deployment to be promoted (live)
|
|
71
|
+
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
72
|
+
const timeoutMs = 5 * 60 * 1000;
|
|
73
|
+
const intervalMs = 5000;
|
|
74
|
+
const start = Date.now();
|
|
75
|
+
log.info(`⏳ Waiting for deployment to be promoted...`);
|
|
76
|
+
let promoted = false;
|
|
77
|
+
while (Date.now() - start < timeoutMs) {
|
|
78
|
+
await wait(intervalMs);
|
|
79
|
+
try {
|
|
80
|
+
const current = await api.getApp(app.id);
|
|
81
|
+
if (current.status?.deployment === deployment.id) {
|
|
82
|
+
promoted = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
// Ignore transient errors while polling and keep waiting
|
|
88
|
+
log.debug(`Polling app status failed, retrying...`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (promoted) {
|
|
92
|
+
log.info(`✅ Deployment promoted and live -> https://${app.url}`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
log.warn(`⌛ Timed out after 5min waiting for promotion. The deployment is still rolling out, check the dashboard -> ${dashboard_url}`);
|
|
96
|
+
}
|
|
70
97
|
}
|
|
71
98
|
};
|
|
72
99
|
|