woodpecker: refactor pipeline

pull/1/head
Ariadne Conill 2022-06-09 02:45:38 +00:00
parent 37d7a64217
commit 8ccc5b0a85
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
@ -11,16 +11,16 @@ 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
@ -29,9 +29,8 @@ pipeline:
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"