Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4099 from hashicorp/feat/status-reports/auto-run-…
Browse files Browse the repository at this point in the history
…check-on-deploy-release

internal/runner: Run a status report on Deployments and Releases
  • Loading branch information
briancain authored Oct 26, 2022
2 parents ef47119 + 37da8d1 commit f55642b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .changelog/4099.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:improvement
core: Auto run a status report after a deployment or release operation rather
than only if `waypoint deploy` or `waypoint release` CLI is run.
```
12 changes: 0 additions & 12 deletions internal/cli/deployment_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ func (c *DeploymentCreateCommand) Run(args []string) int {
hostname = hostnamesResp.Hostnames[0]
}

// Status Report
app.UI.Output("")
_, err = app.StatusReport(ctx, &pb.Job_StatusReportOp{
Target: &pb.Job_StatusReportOp_Deployment{
Deployment: deployment,
},
})
if err != nil {
app.UI.Output(clierrors.Humanize(err), terminal.WithErrorStyle())
return ErrSentinel
}

// Release if we're releasing
var releaseUrl string
if c.flagRelease {
Expand Down
12 changes: 0 additions & 12 deletions internal/cli/release_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,6 @@ func (c *ReleaseCreateCommand) Run(args []string) int {
tbl := fmtVariablesOutput(resp.VariableFinalValues)
c.ui.Table(tbl)

// Status Report
app.UI.Output("")
_, err = app.StatusReport(ctx, &pb.Job_StatusReportOp{
Target: &pb.Job_StatusReportOp_Release{
Release: result.Release,
},
})
if err != nil {
app.UI.Output(clierrors.Humanize(err), terminal.WithErrorStyle())
return ErrSentinel
}

if result.Release.Url == "" {
app.UI.Output("\n"+strings.TrimSpace(releaseNoUrl),
deploy.Id,
Expand Down
6 changes: 6 additions & 0 deletions internal/runner/operation_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func (r *Runner) executeDeployOp(
return nil, err
}

// Run a status report on the recent deployment
_, err = app.DeploymentStatusReport(ctx, deployment)
if err != nil {
return nil, err
}

return &pb.Job_Result{
Deploy: &pb.Job_DeployResult{
Deployment: deployment,
Expand Down
6 changes: 6 additions & 0 deletions internal/runner/operation_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,11 @@ func (r *Runner) executeReleaseOp(
}
}

// Run a status report operation on the recent release
_, err = app.ReleaseStatusReport(ctx, release)
if err != nil {
return nil, err
}

return result, nil
}

0 comments on commit f55642b

Please sign in to comment.