Skip to content

Commit

Permalink
Merge pull request #682 from trade-tariff/bau-fix-prod-deploy
Browse files Browse the repository at this point in the history
HOTT-3919: Fixes production release
  • Loading branch information
amberstarlight committed Aug 31, 2023
2 parents f925204 + e68bf07 commit c9c3820
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
35 changes: 23 additions & 12 deletions .circleci/config.yml
Expand Up @@ -149,6 +149,8 @@ jobs:

plan-terraform:
executor: terraform
environment:
TF_CLI_ARGS: "-lock=false"
parameters:
environment:
type: string
Expand Down Expand Up @@ -180,8 +182,9 @@ jobs:
path: terraform/
backend_config_file: backends/<< parameters.environment >>.tfbackend
var_file: config_<< parameters.environment >>.tfvars
lock-timeout: 5m

checking:
ruby-checks:
docker:
- image: cimg/ruby:3.2.2-node
steps:
Expand Down Expand Up @@ -322,18 +325,21 @@ workflows:

deploy-to-development:
jobs:
- write-docker-tag:
name: write-docker-tag-dev
environment: development
<<: *filter-not-main

- checking:
- ruby-checks:
<<: *filter-not-main

- test:
context: trade-tariff
<<: *filter-not-main

- write-docker-tag:
name: write-docker-tag-dev
environment: development
<<: *filter-not-main
requires:
- ruby-checks
- test

- fmt-validate-terraform:
name: fmt-terraform-dev
context: trade-tariff-terraform-aws-development
Expand Down Expand Up @@ -368,6 +374,8 @@ workflows:
- deploy-dev:
context: trade-tariff
requires:
- test
- ruby-checks
- build-dev
<<: *filter-not-main

Expand All @@ -376,6 +384,7 @@ workflows:
context: trade-tariff-terraform-aws-development
environment: development
requires:
- test
- plan-terraform-dev
- build-and-push-dev
<<: *filter-not-main
Expand Down Expand Up @@ -468,14 +477,16 @@ workflows:
- deploy-production:
context: trade-tariff
<<: *filter-release
requires:
- promote-to-production?

- write-docker-tag:
name: write-docker-tag-prod-release
environment: production
<<: *filter-release

- apply-terraform:
name: apply-terraform-prod
context: trade-tariff-terraform-aws-staging
environment: production
requires:
- write-docker-tag-prod
- promote-to-production?
<<: *filter-main
- write-docker-tag-prod-release
<<: *filter-release
9 changes: 4 additions & 5 deletions terraform/backends/development.tfbackend
@@ -1,5 +1,4 @@
bucket = "terraform-state-development-844815912454"
key = "tariff-duty-calculator.tfstate"
region = "eu-west-2"
encrypt = true
dynamodb_table = "duty-calculator-lock-844815912454"
bucket = "terraform-state-development-844815912454"
key = "tariff-duty-calculator.tfstate"
region = "eu-west-2"
encrypt = true

0 comments on commit c9c3820

Please sign in to comment.