Merge branch 'terraform-apply' into 'main'

Update .gitlab-ci.yml

See merge request developerdurp/homelab!3
This commit is contained in:
2022-11-04 23:50:18 +00:00

View File

@@ -1,6 +1,6 @@
stages: stages:
- plan - lint
- apply - build
- destroy - destroy
include: include:
@@ -9,15 +9,29 @@ 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
allow_failure: false allow_failure: false
extends: .terraform_plan extends: .terraform_plan
only: rules:
changes: - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- terraform/*
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
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
changes:
compare_to: refs/heads/main
paths:
- '/terraform/*'
#apply: #apply:
# stage: apply # stage: apply