Skip to content

Instantly share code, notes, and snippets.

@byF
Created June 5, 2019 13:05
Show Gist options
  • Save byF/f919590b5c235576beded8a941ebc0df to your computer and use it in GitHub Desktop.
Save byF/f919590b5c235576beded8a941ebc0df to your computer and use it in GitHub Desktop.
deployer wait for code
return new Promise(
(resolve, reject) => {
const waitForParams = {
tasks: [taskArn],
cluster: ecs_cluster,
}
//provisioning takes time as well
ecs.waitFor('tasksRunning', waitForParams, (err, data) => {
if (err) {
ecs.describeTasks(waitForParams, (errDt, data) => {
if (errDt) {
reject(errDt)
} else {
console.log('The task is stopped: ' + data.tasks[0].stoppedReason)
reject(err)
}
})
} else {
resolve(true)
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment