diff options
author | Leandro Alves <leandroalves@yahooinc.com> | 2021-11-24 18:17:35 +0100 |
---|---|---|
committer | Leandro Alves <leandroalves@yahooinc.com> | 2021-11-24 18:17:35 +0100 |
commit | 98d7e43c1d9a61f637c90becc4ec320e4a828a59 (patch) | |
tree | b0dabdb709b2d389695a2967b898b29830c7d3db /client | |
parent | 16c425e43a7c3bf70941d758ffcc87cdddaeb3c3 (diff) |
Fix spinner for the 'deploy' command
Diffstat (limited to 'client')
-rw-r--r-- | client/go/auth0/auth0.go | 1 | ||||
-rw-r--r-- | client/go/cmd/deploy.go | 4 | ||||
-rw-r--r-- | client/go/vespa/deploy.go | 7 |
3 files changed, 8 insertions, 4 deletions
diff --git a/client/go/auth0/auth0.go b/client/go/auth0/auth0.go index 43b42cb8960..f8f9bcb8f76 100644 --- a/client/go/auth0/auth0.go +++ b/client/go/auth0/auth0.go @@ -157,6 +157,7 @@ func (a *Auth0) PrepareSystem(ctx context.Context) (System, error) { if err != nil { // ask and guide the user through the login process: fmt.Println(fmt.Errorf("failed to renew access token, %s", err)) + fmt.Print("\n") s, err = RunLogin(ctx, a, true) if err != nil { return System{}, err diff --git a/client/go/cmd/deploy.go b/client/go/cmd/deploy.go index 813abe88069..ae39afc3773 100644 --- a/client/go/cmd/deploy.go +++ b/client/go/cmd/deploy.go @@ -65,9 +65,7 @@ $ vespa deploy -t cloud -z perf.aws-us-east-1c`, target := getTarget() opts := getDeploymentOpts(cfg, pkg, target) - sessionOrRunID, err = vespa.Deploy(opts) - - if err == nil { + if sessionOrRunID, err := vespa.Deploy(opts); err == nil { fmt.Print("\n") if opts.IsCloud() { printSuccess("Triggered deployment of ", color.Cyan(pkg.Path), " with run ID ", color.Cyan(sessionOrRunID)) diff --git a/client/go/vespa/deploy.go b/client/go/vespa/deploy.go index c1cc868e16f..7cd186e6b82 100644 --- a/client/go/vespa/deploy.go +++ b/client/go/vespa/deploy.go @@ -370,7 +370,12 @@ func uploadApplicationPackage(url *url.URL, opts DeploymentOpts) (int64, error) if err := opts.Target.PrepareApiRequest(request, sigKeyId); err != nil { return 0, err } - response, err := util.HttpDo(request, time.Minute*10, serviceDescription) + + var response *http.Response + util.Spinner("Uploading application package ...", func() error { + response, err = util.HttpDo(request, time.Minute*10, serviceDescription) + return err + }) if err != nil { return 0, err } |