This commit is contained in:
2025-03-26 05:06:16 -05:00
parent a593d314e1
commit d9e4945224

View File

@@ -4,8 +4,8 @@ stages:
- destroy - destroy
variables: variables:
WORKDIR: $CI_PROJECT_DIR/dmz/terraform WORKDIR: $CI_PROJECT_DIR/dev/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/dmz GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/dev
image: image:
name: registry.durp.info/opentofu/opentofu:latest name: registry.durp.info/opentofu/opentofu:latest
@@ -33,7 +33,7 @@ format:
- tofu fmt -diff -check -write=false - tofu fmt -diff -check -write=false
rules: rules:
- changes: - changes:
- "dmz/terraform/*.tf" - "dev/terraform/*.tf"
validate: validate:
stage: .pre stage: .pre
@@ -43,14 +43,14 @@ validate:
- tofu validate - tofu validate
rules: rules:
- changes: - changes:
- "dmz/terraform/*.tf" - "dev/terraform/*.tf"
plan-dmz-infrastructure: plan-dev-infrastructure:
stage: plan stage: plan
variables: variables:
PLAN: plan.tfplan PLAN: plan.tfplan
JSON_PLAN_FILE: tfplan.json JSON_PLAN_FILE: tfplan.json
ENVIRONMENT_NAME: dmz ENVIRONMENT_NAME: dev
allow_failure: false allow_failure: false
extends: .tf-init extends: .tf-init
script: script:
@@ -64,32 +64,32 @@ plan-dmz-infrastructure:
needs: ["validate","format"] needs: ["validate","format"]
rules: rules:
- changes: - changes:
- "dmz/terraform/*.tf" - "dev/terraform/*.tf"
apply-dmz-infrastructure: apply-dev-infrastructure:
stage: apply stage: apply
variables: variables:
ENVIRONMENT_NAME: dmz ENVIRONMENT_NAME: dev
allow_failure: false allow_failure: false
extends: .tf-init extends: .tf-init
script: script:
- tofu apply -auto-approve $ARGUMENTS - tofu apply -auto-approve $ARGUMENTS
rules: rules:
- changes: - changes:
- "dmz/terraform/*.tf" - "dev/terraform/*.tf"
when: manual when: manual
needs: ["plan-dmz-infrastructure"] needs: ["plan-dev-infrastructure"]
destroy-dmz-infrastructure: destroy-dev-infrastructure:
stage: destroy stage: destroy
variables: variables:
ENVIRONMENT_NAME: dmz ENVIRONMENT_NAME: dev
allow_failure: false allow_failure: false
extends: .tf-init extends: .tf-init
script: script:
- tofu destroy -auto-approve $ARGUMENTS - tofu destroy -auto-approve $ARGUMENTS
rules: rules:
- changes: - changes:
- "dmz/terraform/*.tf" - "dev/terraform/*.tf"
when: manual when: manual
needs: ["plan-dmz-infrastructure"] needs: ["plan-dev-infrastructure"]