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: pipeline:
validate: validate:
image: alpine image: alpine:3.16
when: when:
path: "dns/**" path: "dns/**"
event: pull_request event: pull_request
@ -11,16 +11,16 @@ pipeline:
commands: commands:
- apk add --no-cache terraform - apk add --no-cache terraform
- terraform version - terraform version
- | - cd dns
cd dns - terraform init
echo 'token = "$${LINODE_TOKEN}"' > .auto.tfvars - terraform validate
terraform validate - terraform plan -var "token=$LINODE_TOKEN"
terraform plan
deploy: deploy:
image: alpine image: alpine:3.16
when: when:
path: "dns/**" path: "dns/**"
branch: main
event: push event: push
secrets: secrets:
- linode_token - linode_token
@ -29,9 +29,8 @@ pipeline:
commands: commands:
- apk add --no-cache terraform - apk add --no-cache terraform
- terraform version - terraform version
- | - cd dns
cd dns - terraform init
echo 'token = "$${LINODE_TOKEN}"' > .auto.tfvars - terraform validate
terraform validate - terraform plan -out deploy.plan -var "token=$LINODE_TOKEN"
terraform plan -out deploy.plan - terraform apply deploy.plan -var "token=$LINODE_TOKEN"
terraform apply deploy.plan