Resume a deployment
If your process restarts, look up the deployment by buildId / build_id and call wait() again.
Retrieve the deployment
Pass the buildId you saved when the deploy started. Check status to see whether the build is still running.
retrieveDeployment.js
1
const buildId = "your-build-id";
2
const deployment = await client.deployments.retrieve(buildId);
3
// Should return: {// { ... }
8
console.log(deployment.buildId, deployment.status);
Wait for the build
Call wait() on the retrieved deployment to resume streaming logs until completion.
retrieveDeployment.js
1
const appVersion = await deployment.wait({
2
onProgress: ({ kind, message, datetime, stream }) => {
3
console.log(datetime, stream, kind, message);
4
},
5
});
6
// Should return: {// { ... }
10
console.log(appVersion.id, appVersion.app.url);
Source: stackmachine/sdks examples.