From 73ff739832affb133196bc202228ccce370c3d1a Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sat, 5 Nov 2022 13:29:35 +0000 Subject: [PATCH] Update .gitlab-ci.yml, terraform/variables.tf --- .gitlab-ci.yml | 16 ++++++++++++++++ terraform/variables.tf | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8002b70..e8d7c0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,21 @@ format: when: always - when: never +validate: + stage: lint + variables: + WORKDIR: $CI_PROJECT_DIR/terraform + allow_failure: false + extends: .terraform_validate + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + compare_to: refs/heads/main + paths: + - 'terraform/*' + when: always + - when: never + plan: stage: lint variables: @@ -32,6 +47,7 @@ plan: ARGUMENTS: -var=pm_password=$pm_password -var=pm_api_url=$pm_api_url -var-file=terraform.tfvars allow_failure: false extends: .terraform_plan + needs: ["validate","format"] rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: diff --git a/terraform/variables.tf b/terraform/variables.tf index f7c7662..3dc77f4 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -35,7 +35,7 @@ variable "k3master" { storage = string template = string node = string - ip = list(number) + ip = list(number) }) }