Update 3 files

- /pipelines/terraform-gitlab.yml
- /pipelines/terraform.yml
- /templates/terraform.tpl.yml
This commit is contained in:
2023-08-13 13:02:53 +00:00
parent b8a1ffd020
commit 94e8153768
3 changed files with 18 additions and 33 deletions

View File

@@ -3,6 +3,15 @@ stages:
- apply - apply
- destroy - destroy
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
include: include:
- project: 'developerdurp/yml' - project: 'developerdurp/yml'
ref: main ref: main

View File

@@ -3,6 +3,15 @@ stages:
- apply - apply
- destroy - destroy
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
include: include:
- project: 'developerdurp/yml' - project: 'developerdurp/yml'
ref: main ref: main

View File

@@ -1,37 +1,18 @@
.terraform_fmt: .terraform_fmt:
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
script: script:
- ./scripts/cd-workdir.sh - ./scripts/cd-workdir.sh
- ./scripts/terraform-fmt.sh - ./scripts/terraform-fmt.sh
.terraform_validate: .terraform_validate:
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
script: script:
- ./scripts/cd-workdir.sh - ./scripts/cd-workdir.sh
- ./scripts/terraform-init.sh - ./scripts/terraform-init.sh
- ./scripts/terraform-validate.sh - ./scripts/terraform-validate.sh
.terraform_plan: .terraform_plan:
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
variables: variables:
WORKDIR: $CI_PROJECT_DIR/terraform
PLAN: plan.tfplan PLAN: plan.tfplan
JSON_PLAN_FILE: tfplan.json JSON_PLAN_FILE: tfplan.json
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
script: script:
- ./scripts/cd-workdir.sh - ./scripts/cd-workdir.sh
- ./scripts/terraform-init.sh - ./scripts/terraform-init.sh
@@ -42,26 +23,12 @@
.terraform_apply: .terraform_apply:
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
script: script:
- ./scripts/cd-workdir.sh - ./scripts/cd-workdir.sh
- ./scripts/terraform-init.sh - ./scripts/terraform-init.sh
- ./scripts/terraform-apply.sh - ./scripts/terraform-apply.sh
.terraform_destroy: .terraform_destroy:
image:
name: registry.durp.info/hashicorp/terraform:light
#name: hashicorp/terraform:light
entrypoint: [""]
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME}
script: script:
- ./scripts/cd-workdir.sh - ./scripts/cd-workdir.sh
- ./scripts/terraform-init.sh - ./scripts/terraform-init.sh