ephemeral-jamulus/.gitlab-ci.yml
2023-01-05 14:23:11 +01:00

59 lines
992 B
YAML

image:
name: hashicorp/terraform:light
entrypoint: [""]
stages:
- tf-validate
- tf-plan
- tf-apply
- tf-destroy
tf-validate:
stage: tf-validate
script:
- terraform init
- terraform validate
tf-plan:
stage: tf-plan
script:
- terraform init
- terraform plan -out plan.tfplan
artifacts:
paths:
- plan.tfplan
tf-apply:
stage: tf-apply
image:
name: hashicorp/terraform
entrypoint: [""]
before_script:
- apk add ansible
- ansible-galaxy collection install community.docker
- chmod 600 barotrauma.pem
script:
- terraform init
- terraform apply plan.tfplan
dependencies:
- tf-plan
when: manual
only:
- master
tf-destroy:
stage: tf-destroy
image:
name: hashicorp/terraform
entrypoint: [""]
before_script:
- apk add ansible
- chmod 600 barotrauma.pem
script:
- terraform init
- terraform destroy
dependencies:
- tf-plan
when: manual
only:
- master