Update .gitlab-ci.yml

This commit is contained in:
2022-11-04 23:45:28 +00:00
parent 281b0a789e
commit f845be733f

View File

@@ -1,6 +1,6 @@
stages: stages:
- plan - lint
- apply - build
- destroy - destroy
include: include:
@@ -9,7 +9,7 @@ include:
file: 'terraform.yml' file: 'terraform.yml'
plan: plan:
stage: plan stage: lint
variables: variables:
WORKDIR: $CI_PROJECT_DIR/terraform WORKDIR: $CI_PROJECT_DIR/terraform
ARGUMENTS: -var=pm_password=$pm_password -var=pm_api_url=$pm_api_url -var-file=terraform.tfvars ARGUMENTS: -var=pm_password=$pm_password -var=pm_api_url=$pm_api_url -var-file=terraform.tfvars
@@ -17,7 +17,23 @@ plan:
extends: .terraform_plan extends: .terraform_plan
only: only:
changes: changes:
- terraform/* - terraform/*
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
apply:
stage: build
variables:
WORKDIR: $CI_PROJECT_DIR/terraform
ARGUMENTS: -var=pm_password=$pm_password -var=pm_api_url=$pm_api_url -var-file=terraform.tfvars
allow_failure: false
extends: .terraform_apply
only:
changes:
- terraform/*
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
#apply: #apply:
# stage: apply # stage: apply