From 94e8153768e59049f64389458849031905b3a1b7 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 13 Aug 2023 13:02:53 +0000 Subject: [PATCH] Update 3 files - /pipelines/terraform-gitlab.yml - /pipelines/terraform.yml - /templates/terraform.tpl.yml --- pipelines/terraform-gitlab.yml | 9 +++++++++ pipelines/terraform.yml | 9 +++++++++ templates/terraform.tpl.yml | 33 --------------------------------- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/pipelines/terraform-gitlab.yml b/pipelines/terraform-gitlab.yml index e014acb..33d0585 100644 --- a/pipelines/terraform-gitlab.yml +++ b/pipelines/terraform-gitlab.yml @@ -3,6 +3,15 @@ stages: - apply - 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: - project: 'developerdurp/yml' ref: main diff --git a/pipelines/terraform.yml b/pipelines/terraform.yml index 2aa7d12..f2c2a04 100644 --- a/pipelines/terraform.yml +++ b/pipelines/terraform.yml @@ -3,6 +3,15 @@ stages: - apply - 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: - project: 'developerdurp/yml' ref: main diff --git a/templates/terraform.tpl.yml b/templates/terraform.tpl.yml index d176aa2..9e150d2 100644 --- a/templates/terraform.tpl.yml +++ b/templates/terraform.tpl.yml @@ -1,37 +1,18 @@ .terraform_fmt: - image: - name: registry.durp.info/hashicorp/terraform:light - #name: hashicorp/terraform:light - entrypoint: [""] - variables: - WORKDIR: $CI_PROJECT_DIR/terraform script: - ./scripts/cd-workdir.sh - ./scripts/terraform-fmt.sh .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: - ./scripts/cd-workdir.sh - ./scripts/terraform-init.sh - ./scripts/terraform-validate.sh .terraform_plan: - image: - name: registry.durp.info/hashicorp/terraform:light - #name: hashicorp/terraform:light - entrypoint: [""] variables: - WORKDIR: $CI_PROJECT_DIR/terraform PLAN: plan.tfplan JSON_PLAN_FILE: tfplan.json - GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${ENVIRONMENT_NAME} script: - ./scripts/cd-workdir.sh - ./scripts/terraform-init.sh @@ -42,26 +23,12 @@ .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: - ./scripts/cd-workdir.sh - ./scripts/terraform-init.sh - ./scripts/terraform-apply.sh .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: - ./scripts/cd-workdir.sh - ./scripts/terraform-init.sh