Created
June 5, 2019 13:05
-
-
Save byF/f919590b5c235576beded8a941ebc0df to your computer and use it in GitHub Desktop.
deployer wait for code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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