copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Missing DeployTo-{env} stage in pipeline

Open federicobond opened this issue 1 year ago • 6 comments

Hi! From the docs I was expecting to see a DeployTo-* stage in a new pipeline created with copilot pipeline init but my pipeline only has Source and Build stages.

Under what conditions is the deploy stage created? I could find no information about it online.

I am running copilot v1.33.

federicobond avatar Jan 29 '24 22:01 federicobond

Apparently if you add a stages.deployments.{svc} key to the pipeline manifest it creates a DeployTo stage, but the docs make it look like this should only be required when you want to manually control deployment ordering.

federicobond avatar Jan 29 '24 22:01 federicobond

Hello @federicobond !

Sorry for the confusion that you had. Can you point me to the docs where this is mentioned so that i can fix this.

but the docs make it look like this should only be required when you want to manually control deployment ordering.

KollaAdithya avatar Jan 29 '24 22:01 KollaAdithya

It's partly this section and the fact that the deployments field is not mentioned previously.

federicobond avatar Jan 29 '24 23:01 federicobond

Hello @federicobond !

That seems to be correct to me. deployments are indeed helps to control the order of deployments of a service and the field is optional. If not specified then all the workloads in that environment is deployed in parallel.

You need to specify the stages.name (required) to generate the DeployTo-{env } stage in the pipeline.

For example, In your pipeline manifest you at least need the below snippet ⬇️

stages:
  - name: test # Deploys all the workloads to test environment.

KollaAdithya avatar Jan 30 '24 01:01 KollaAdithya

I can confirm that I had the stages.name set and it did not create a DeployTo-{env} stage for whatever reason. It was only after I added the deployments key that the stage was included.

federicobond avatar Jan 30 '24 01:01 federicobond

I could not reproduce the issue with version v1.33.

Can you please reverify for me by doing the following

  1. Create a Pipeline with below command
 copilot pipeline init \    
   --name frontend-main \  
   --url https://github.com/gitHubUserName/frontend.git \  
   --git-branch main \  
   --environments "test,prod" \
   --pipeline-type "Workloads"
  1. Run command copilot pipeline deploy --diff to see the diff of the pipeline.

  2. git add copilot/ && git commit -m "Adding pipeline artifacts" && git push

  3. copilot pipeline deploy

After running these commands can you verify in the CloudFormation template, There should be couple of stages DeployTo-test and DeployTo-prod in the CodePipeline.

KollaAdithya avatar Jan 30 '24 04:01 KollaAdithya

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar Mar 31 '24 00:03 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!

github-actions[bot] avatar Apr 14 '24 00:04 github-actions[bot]