Skip to content

Commit

Permalink
checks status, blocks deploy while dead (paused)
Browse files Browse the repository at this point in the history
  • Loading branch information
codepope committed Jun 24, 2020
1 parent d97ea8f commit 0d6687f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ func runDeploy(commandContext *cmdctx.CmdContext) error {
}
}

appcheck, err := commandContext.Client.API().GetApp(commandContext.AppName)

if err != nil {
return err
}

if appcheck.Status == "dead" {
return fmt.Errorf("app %s is currently paused - resume it with flyctl apps resume", commandContext.AppName)
}

var strategy = docker.DefaultDeploymentStrategy
if val, _ := commandContext.Config.GetString("strategy"); val != "" {
strategy, err = docker.ParseDeploymentStrategy(val)
Expand Down Expand Up @@ -291,7 +301,6 @@ func watchDeployment(ctx context.Context, commandContext *cmdctx.CmdContext) err
commandContext.Statusf("deploy", cmdctx.SDETAIL, "v%d %s - %s\n", d.Version, d.Status, d.Description)

if len(failedAllocs) > 0 {
fmt.Fprintln(commandContext.Out)
commandContext.Status("flyctl", cmdctx.STITLE, "Failed Allocations")

x := make(chan *api.AllocationStatus)
Expand Down

0 comments on commit 0d6687f

Please sign in to comment.