-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
access task run command's exit code #2525
Comments
I 've found some thought at the command design issue, but as far as I 've tested this is not implemented.
|
Ooh hi @nbarrera ! That's a great feature request, you're right we don't have a way yet of reflecting the task exit code at the moment 🙇 Looks like we can achieve this by calling |
Sorry @efekarakus, I think I may use your suggestion of calling I would like to ask you: Is there a way to get the task id (so I can pass it to |
Hi @nbarrera! Unfortunately we don't surface task ID at this moment😞 Right now you'd be able to access the task's ARN by calling For example, if using aws cli, you can run
There may be more than one results in the response, depending on the In that case, you may check the task definition version to find the latest deployment. An alternative way is to run
but this will only give you the RUNNING tasks instead of the STOPPED one :( if you're able to run this command after the task is running, and feed the ARN to I'm sorry that there's so much steps for a simple tasks 😞 I will update the answer if I find a simpler solution too. Meanwhile, thank you for the great feature request!!! |
I'd also love to have this feature! But in the mean time if anyone else is wondering about this, I think this is the work around I'm going to go with, it's a little janky but should do the trick.
copilot_task.sh (The code you actually run on AWS)
launch_copilot_task.sh (The code you use to launch the task)
That's all there is to it! (Note! This is an example and I haven't tested this in production!) |
From gitter as well:
This feature request makes a lot of sense ! An alternative design, could be something like :
but I think it makes sense to exit with a non-zero value if any of the tasks with |
This PR addresses the issue #2525 This PR adds an ability to fail the `copilot task run --follow` command with non zero exit code when essential container of the task fails. <img width="773" alt="Screen Shot 2022-05-31 at 5 57 30 PM" src="https://user-images.githubusercontent.com/18301288/171307223-69c3d41d-38d3-46e8-ae98-1558c25c9b41.png">
Hey all 👋🏻 solving a similar issue as the OP - super cool to see this is already implemented in #3620 🙏🏻 is there an estimate of when you want to ship the next release? Thanks |
Hey @raethlo! Glad to see you'll be able to make use of this feature.🎉 We are planning on releasing it this month!😊 |
Closing this issue since the feature has been released v1.20.0! Feel free to reopen for further questions. |
I got my CI's step executing a copilot task run, the task fails with
exit 1
and I would like the CI step to fail and bail without executing the following step on the CI pipeline.Here is the tail of the
Dockerfile
I 'm feeding thetask run
Here is an
task run
output excerpt (note command failed with exit 1)When issued manually from my computer, output is the same and right after that I get the
task run
exit code like this (note thetask run
exit code is 0 even if the command's exit code was 1)Is there a way to get what's the exit code of the task that ran inside the container?
If I run that dockerfile locally I can get that:
So, if the
task run
command does not forward the command's exit code.., could I get it somehow?thank you in advance guys
The text was updated successfully, but these errors were encountered: