From 5f7dea992150970cf95681f15298a7eb210316f0 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 14 Aug 2019 18:16:54 +0900 Subject: [PATCH] Settle and show shell details upfront --- worker/context.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/worker/context.go b/worker/context.go index 2007998..7456655 100644 --- a/worker/context.go +++ b/worker/context.go @@ -172,8 +172,20 @@ func (wctx *WorkerContext) RunBuild( cleanup = ctx.Boot(wctx.Redis) + if err = ctx.Settle(); err != nil { + panic(err) + } + + if manifest.Shell { + ctx.Log.Println() + ctx.Log.Println("\x1B[1m\x1B[96mShell access for this build was requested.\x1B[0m") + ctx.Log.Println("To log in with SSH, use the following command:") + ctx.Log.Println() + ctx.Log.Printf("\tssh -t builds@%s connect %d", runner, job_id) + ctx.Log.Println() + } + tasks := []func() error{ - ctx.Settle, ctx.SendTasks, ctx.SendEnv, ctx.SendSecrets, @@ -192,12 +204,6 @@ func (wctx *WorkerContext) RunBuild( ctx.Task = ctx.NTasks if manifest.Shell { - ctx.Log.Println() - ctx.Log.Println("\x1B[1m\x1B[96mShell access for this build was requested.\x1B[0m") - ctx.Log.Println("To log in with SSH, use the following command:") - ctx.Log.Println() - ctx.Log.Printf("\tssh -t builds@%s connect %d", runner, job_id) - ctx.Log.Println() <-goctx.Done() } -- 2.38.5