From ac2577a03dc1cb3f9929270d3beac20a51a219b1 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 14 Aug 2019 11:57:36 +0900 Subject: [PATCH] Print out connection info on shell jobs --- worker/context.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/worker/context.go b/worker/context.go index 67e3a3a..23ced6f 100644 --- a/worker/context.go +++ b/worker/context.go @@ -89,7 +89,8 @@ func (wctx *WorkerContext) RunBuild( if err != nil { panic(errors.Wrap(err, "GetJob")) } - if err = job.SetRunner(conf("builds.sr.ht::worker", "name")); err != nil { + runner := conf("builds.sr.ht::worker", "name") + if err = job.SetRunner(runner); err != nil { panic(errors.Wrap(err, "job.SetRunner")) } if err = job.SetStatus("running"); err != nil { @@ -174,7 +175,12 @@ func (wctx *WorkerContext) RunBuild( } if manifest.Shell { - ctx.Log.Println("TODO: Print shell access details here") + 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 builds@%s connect %d", runner, job_id) + ctx.Log.Println() <-goctx.Done() } -- 2.38.5