CircleCI

Usage

This example triggers a deployment in CircleCI when code is deployed to the "Staging" environment for more than 4 hours and is healthy:
1
rules:
2
- run-deploy:
3
conditions:
4
- environment='Staging'
5
- deployed_for>'4h'
6
- health='Healthy'
7
actions:
8
- trigger_build:
9
parameters:
10
run_deploy: true
11
environment: production
Copied!
It passes several parameters to be used by CircleCI: run_deploy and environment. For more information about how to declare parameters and filter workflows in CircleCI, see the CircleCI documentation.
This is an example of the CircleCI configuration that uses the run_deploy parameter to selectively execute a workflow, while the environment parameter is used within the job to perform the deployment:
1
parameters:
2
run_deploy:
3
default: false
4
type: boolean
5
environment:
6
type: string
7
default: staging
8
9
jobs:
10
run-deploy:
11
docker:
12
- image: circleci/python:3.8.6
13
steps:
14
- run:
15
command: |
16
echo "Deploying to <<pipeline.parameters.environment>>"
17
18
19
workflows:
20
deploy:
21
when: << pipeline.parameters.run_deploy >>
22
jobs:
23
- run-deploy
Copied!
Last modified 5mo ago
Copy link