@@ -84,7 +84,7 @@ func run(ctx context.Context, environmentName string, options *clioptions.CLIOpt
8484 }
8585 fmt .Printf ("Deploying project %s in the environment '%s'\n " , projectID , environmentName )
8686
87- status , err := waitStatus (ctx , client , projectID , resp .ID )
87+ status , err := waitStatus (ctx , client , projectID , resp .ID , environmentName )
8888 if err != nil {
8989 return fmt .Errorf ("error retrieving the pipeline status: %w" , err )
9090 }
@@ -136,13 +136,14 @@ func triggerPipeline(ctx context.Context, client *client.APIClient, environmentN
136136// Declared here to override it during tests
137137var sleepDuration = (1 * time .Second ) + (500 * time .Millisecond )
138138
139- func waitStatus (ctx context.Context , client * client.APIClient , projectID string , deployID int ) (string , error ) {
139+ func waitStatus (ctx context.Context , client * client.APIClient , projectID string , deployID int , environmentName string ) (string , error ) {
140140 var outStatus * resources.PipelineStatus
141141 for {
142142 time .Sleep (sleepDuration )
143143 resp , err := client .
144144 Get ().
145145 APIPath (fmt .Sprintf (pipelineStatusEndpointTemplate , projectID , deployID )).
146+ SetParam ("environment" , environmentName ).
146147 Do (ctx )
147148
148149 if err != nil {
0 commit comments