@@ -87,6 +87,15 @@ func (p *AppPushOperation) pushBlueGreenApp(ctx context.Context, space *resource
8787 return p .pushApp (ctx , space , manifest , zipFile )
8888 }
8989
90+ if p .stopped {
91+ // If stopped flag is set just stop the original app and return
92+ _ , err = p .client .Applications .Stop (ctx , originalApp .GUID )
93+ if err != nil {
94+ return nil , fmt .Errorf ("failed to stop the application with: %w" , err )
95+ }
96+ return originalApp , err
97+ }
98+
9099 tempAppName := originalApp .Name + "-venerable"
91100
92101 // Check if temporary app name already exists if yes gracefully delete the app and continue
@@ -133,6 +142,16 @@ func (p *AppPushOperation) pushRollingApp(ctx context.Context, space *resource.S
133142 if errors .Is (err , client .ErrExactlyOneResultNotReturned ) || originalApp .State != "STARTED" {
134143 return p .pushApp (ctx , space , manifest , zipFile )
135144 }
145+
146+ if p .stopped {
147+ // If stopped flag is set just stop the original app and return
148+ _ , err = p .client .Applications .Stop (ctx , originalApp .GUID )
149+ if err != nil {
150+ return nil , fmt .Errorf ("failed to stop the application with: %w" , err )
151+ }
152+ return originalApp , err
153+ }
154+
136155 // Get the fallback revision in case of rollback
137156 fallbackRevision , _ := p .client .Revisions .SingleForAppDeployed (ctx , originalApp .GUID , nil )
138157
0 commit comments