We propose adding support for a deployments field under stages to the pipeline manifest in order to control which workloads should be deployed and their deployment order in a stage.
stage:
- name: string
requires_approval: boolean
test_commands: [string, ...]
deployments: # Optional. New.
<name>: # Name for the codepipeline Deploy action.
stack_name: string # Optional. Defaults to {app name}-{stage name}-{name}
template_path: string # Optional. Path to the generated template during Build. Defaults to infrastructure/{name}-{stage name}.yml
template_config: string # Optional. Path to the generated config file during Build. Defaults to infrastructure/{name}-{stage name}.params.json
depends_on: [string, ...] # Optional. Actions that need to happen before this one.
An example
For example, let's say we have an application with two environments, "test" and "prod", and services organized in a monorepo:
copilot/
├── worker
│ └── manifest.yml
└── www
└── manifest.yml
Now we can run copilot pipeline init and modify the pipeline manifest like this:
name: pipeline-sample-app
stages:
- name: test
deployments:
worker:
- name: prod
deployments:
worker:
The above manifest will allow us to restrict the pipeline to deploy only the "worker" service instead of both "worker" and "www" in parallel.
I could also modify my manifest file like this:
stages:
- name: test
deployments:
worker:
www:
depends_on:
- worker
- name: prod
deployments:
worker:
www:
depends_on:
- worker
To create an order between deployments, first the "worker" service will be deployed and then the "www" service.
Related #2935
We propose adding support for a
deploymentsfield understagesto the pipeline manifest in order to control which workloads should be deployed and their deployment order in a stage.An example
For example, let's say we have an application with two environments, "test" and "prod", and services organized in a monorepo:
Now we can run
copilot pipeline initand modify the pipeline manifest like this:The above manifest will allow us to restrict the pipeline to deploy only the "worker" service instead of both "worker" and "www" in parallel.
I could also modify my manifest file like this:
To create an order between deployments, first the "worker" service will be deployed and then the "www" service.
Related #2935