mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add support for coder_script (#9584)
* Add basic migrations * Improve schema * Refactor agent scripts into it's own package * Support legacy start and stop script format * Pipe the scripts! * Finish the piping * Fix context usage * It works! * Fix sql query * Fix SQL query * Rename `LogSourceID` -> `SourceID` * Fix the FE * fmt * Rename migrations * Fix log tests * Fix lint err * Fix gen * Fix story type * Rename source to script * Fix schema jank * Uncomment test * Rename proto to TimeoutSeconds * Fix comments * Fix comments * Fix legacy endpoint without specified log_source * Fix non-blocking by default in agent * Fix resources tests * Fix dbfake * Fix resources * Fix linting I think * Add fixtures * fmt * Fix startup script behavior * Fix comments * Fix context * Fix cancel * Fix SQL tests * Fix e2e tests * Interrupt on Windows * Fix agent leaking script process * Fix migrations * Fix stories * Fix duplicate logs appearing * Gen * Fix log location * Fix tests * Fix tests * Fix log output * Show display name in output * Fix print * Return timeout on start context * Gen * Fix fixture * Fix the agent status * Fix startup timeout msg * Fix command using shared context * Fix timeout draining * Change signal type * Add deterministic colors to startup script logs --------- Co-authored-by: Muhammad Atif Ali <atif@coder.com>
This commit is contained in:
co-authored by
Muhammad Atif Ali
parent
dac1375880
commit
1262eef2c0
+5
-7
@@ -143,13 +143,11 @@ func (r *RootCmd) ssh() *clibase.Cmd {
|
||||
case "no":
|
||||
wait = false
|
||||
case "auto":
|
||||
switch workspaceAgent.StartupScriptBehavior {
|
||||
case codersdk.WorkspaceAgentStartupScriptBehaviorBlocking:
|
||||
wait = true
|
||||
case codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking:
|
||||
wait = false
|
||||
default:
|
||||
return xerrors.Errorf("unknown startup script behavior %q", workspaceAgent.StartupScriptBehavior)
|
||||
for _, script := range workspaceAgent.Scripts {
|
||||
if script.StartBlocksLogin {
|
||||
wait = true
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
return xerrors.Errorf("unknown wait value %q", waitEnum)
|
||||
|
||||
Reference in New Issue
Block a user