|
|
@@ -202,8 +202,6 @@ func Update(ctx context.Context, inp UpdateInput) error {
|
|
|
|
|
|
now := time.Now().UTC()
|
|
|
|
|
|
- var status *porter_app.GetAppRevisionStatusResponse
|
|
|
-
|
|
|
for {
|
|
|
if time.Since(now) > checkDeployTimeout {
|
|
|
return errors.New("timed out waiting for app to deploy")
|
|
|
@@ -218,6 +216,10 @@ func Update(ctx context.Context, inp UpdateInput) error {
|
|
|
return errors.New("unable to determine status of app revision")
|
|
|
}
|
|
|
|
|
|
+ if status.AppRevisionStatus.IsInTerminalStatus {
|
|
|
+ break
|
|
|
+ }
|
|
|
+
|
|
|
if status.AppRevisionStatus.PredeployStarted {
|
|
|
color.New(color.FgGreen).Printf("Waiting for predeploy to complete...\n") // nolint:errcheck,gosec
|
|
|
}
|
|
|
@@ -226,10 +228,6 @@ func Update(ctx context.Context, inp UpdateInput) error {
|
|
|
color.New(color.FgGreen).Printf("Waiting for deploy to complete...\n") // nolint:errcheck,gosec
|
|
|
}
|
|
|
|
|
|
- if status.AppRevisionStatus.IsInTerminalStatus {
|
|
|
- break
|
|
|
- }
|
|
|
-
|
|
|
time.Sleep(checkDeployFrequency)
|
|
|
}
|
|
|
|
|
|
@@ -242,6 +240,15 @@ func Update(ctx context.Context, inp UpdateInput) error {
|
|
|
CommitSHA: commitSHA,
|
|
|
})
|
|
|
|
|
|
+ status, err := client.GetRevisionStatus(ctx, cliConf.Project, cliConf.Cluster, appName, updateResp.AppRevisionId)
|
|
|
+ if err != nil {
|
|
|
+ return fmt.Errorf("error getting app revision status: %w", err)
|
|
|
+ }
|
|
|
+
|
|
|
+ if status == nil {
|
|
|
+ return errors.New("unable to determine status of app revision")
|
|
|
+ }
|
|
|
+
|
|
|
if status.AppRevisionStatus.InstallFailed {
|
|
|
return errors.New("app failed to deploy")
|
|
|
}
|