terraform/.woodpecker/dns.yml

39 lines
1.0 KiB
YAML

pipeline:
validate:
image: alpine:3.16
when:
path: "dns/**"
event: pull_request
commands:
- apk add --no-cache terraform
- terraform version
- cd dns
- env
- terraform init
- terraform validate
- terraform plan -var "token=$LINODE_TOKEN"
environment:
LINODE_TOKEN:
from_secret: linode_token
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
secrets: [linode_token, aws_access_key_id, aws_secret_access_key]
deploy:
image: alpine:3.16
when:
path: "dns/**"
branch: main
event: push
commands:
- apk add --no-cache terraform
- terraform version
- cd dns
- terraform init
- terraform validate
- terraform plan -out deploy.plan -var "token=$LINODE_TOKEN"
- terraform apply deploy.plan -var "token=$LINODE_TOKEN"
secrets: [linode_token, aws_access_key_id, aws_secret_access_key]