- Notifications
You must be signed in to change notification settings - Fork929
fix: make agent scripts easier to troubleshoot#2922
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
trap { | ||
Write-Error '=== Agent script exited with non-zero code. Sleeping 24h to preserve logs...' | ||
Start-Sleep -Seconds 86400 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
TIL that PS also hastrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Beautiful, and props on figuring out how to do this neatly in Windows! 🤩
Uh oh!
There was an error while loading.Please reload this page.
This PR makes the following changes:
Tested Linux script with a Docker template, Windows script with
aws-windows
template, and Darwin script by running locally with an existing Coder agent token.Note: I also ranPSScriptAnalyzer on the PowerShell script and changed things until it no longer complained.