ephemeral-jamulus/.gitlab-ci.yml

83 lines
1.5 KiB
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-private:
stage: tf-apply
image:
name: hashicorp/terraform
entrypoint: [""]
before_script:
- apk add ansible
- ansible-galaxy collection install community.docker
- chmod 600 jamulus.pem
script:
- terraform init
- terraform apply plan.tfplan
environment:
name: Just Jammin
url: https://ejam.vereto.net
dependencies:
- tf-plan
when: manual
only:
- master
tf-apply-public:
stage: tf-apply
image:
name: hashicorp/terraform
entrypoint: [""]
before_script:
- apk add ansible
- ansible-galaxy collection install community.docker
- chmod 600 jamulus.pem
script:
- terraform init
- terraform apply plan.tfplan -var="broadcast_enabled=true"
environment:
name: Public Jammin
url: https://ejam.vereto.net
dependencies:
- tf-plan
when: manual
only:
- master
tf-destroy:
stage: tf-destroy
image:
name: hashicorp/terraform
entrypoint: [""]
before_script:
- apk add ansible
- chmod 600 jamulus.pem
script:
- terraform init
- terraform destroy -auto-approve
dependencies:
- tf-plan
when: manual
only:
- master