lib/template/.circleci/config.yml in terraspace_ci_circleci-0.1.0 vs lib/template/.circleci/config.yml in terraspace_ci_circleci-0.2.0
- old
+ new
@@ -7,51 +7,68 @@
manual:
type: boolean
default: false
jobs:
- # Manually triggered: TS_ENV=prod
- prod_plan:
+ dev_plan:
docker:
- image: cimg/ruby:3.1.0
environment: *common_env_vars
steps:
- checkout
- run: .circleci/bin/install
- - run: TS_ENV=prod terraspace plan demo
- prod_up:
+ - run: terraspace plan demo
+ dev_up:
docker:
- image: cimg/ruby:3.1.0
environment: *common_env_vars
steps:
- checkout
- run: .circleci/bin/install
- - run: TS_ENV=prod terraspace up demo -y
-
- # On PR: TS_ENV=dev terraspace plan
- # On push: TS_ENV=dev terraspace up - checks a specific branch only
- dev_plan_or_up:
+ - run: terraspace up demo -y
+ # Manually triggered: TS_ENV=prod
+ prod_plan:
docker:
- image: cimg/ruby:3.1.0
environment: *common_env_vars
steps:
- checkout
- run: .circleci/bin/install
- - run: .circleci/bin/terraspace-plan-or-up.sh demo # depends if PR
+ - run: TS_ENV=prod terraspace plan demo
+ prod_up:
+ docker:
+ - image: cimg/ruby:3.1.0
+ environment: *common_env_vars
+ steps:
+ - checkout
+ - run: .circleci/bin/install
+ - run: TS_ENV=prod terraspace up demo -y
workflows:
- prod_plan_then_up_with_approval:
+ # use different dev_plan and dev_up workflows so it shows up on the CircleCI dashboard
+ dev_plan:
+ when:
+ not: << pipeline.parameters.manual >>
+ jobs:
+ - dev_plan:
+ filters:
+ branches:
+ ignore: main
+ dev_up:
+ when:
+ not: << pipeline.parameters.manual >>
+ jobs:
+ - dev_up:
+ filters:
+ branches:
+ only: main
+ prod_with_approval:
when: << pipeline.parameters.manual >>
jobs:
- prod_plan
- hold:
type: approval
requires:
- prod_plan
- prod_up:
requires:
- hold
- dev_plan_or_up:
- when:
- not: << pipeline.parameters.manual >>
- jobs:
- - dev_plan_or_up
\ No newline at end of file