woodpecker: refactor pipeline

Ariadne Conill 2022-06-09 02:45:38 +00:00
parent 62e7672b08
commit 261ce93daa
1 changed files with 12 additions and 13 deletions

View File

@ -1,6 +1,6 @@
pipeline:
validate:
image: alpine
image: alpine:3.16
when:
path: "dns/**"
event: pull_request
@ -9,25 +9,24 @@ pipeline:
commands:
- apk add --no-cache terraform
- terraform version
- |
cd dns
echo 'token = "$${LINODE_TOKEN}"' > .auto.tfvars
terraform validate
terraform plan
- cd dns
- terraform init
- terraform validate
- terraform plan -var "token=$LINODE_TOKEN"
deploy:
image: alpine
image: alpine:3.16
when:
path: "dns/**"
branch: main
event: push
secrets:
- linode_token
commands:
- apk add --no-cache terraform
- terraform version
- |
cd dns
echo 'token = "$${LINODE_TOKEN}"' > .auto.tfvars
terraform validate
terraform plan -out deploy.plan
terraform apply deploy.plan
- cd dns
- terraform init
- terraform validate
- terraform plan -out deploy.plan -var "token=$LINODE_TOKEN"
- terraform apply deploy.plan -var "token=$LINODE_TOKEN"