ci: add drone.yml
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-05-26 01:48:32 +02:00
parent 478b173c7b
commit 185fd650c5

48
.drone.yml Normal file
View File

@@ -0,0 +1,48 @@
---
kind: pipeline
type: kubernetes
name: Terraform root module
trigger:
event:
- cron
- push
branch:
- main
steps:
- name: pipeline init
image: hashicorp/terraform:1.1.8
commands:
- mkdir -p ~/.ssh
- chmod 755 ~/.ssh
- echo "$${CI_SSH_KEY}" | base64 -d > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- rm -f /dev/tty
- mknod -m 666 /dev/tty c 5 0
environment:
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
CI_SSH_KEY:
from_secret: ci-ssh-key
- name: terraform init
image: hashicorp/terraform:1.1.8
commands:
- terraform init
- name: terraform plan
image: hashicorp/terraform:1.1.8
commands:
- terraform plan -out .tfplan
- name: terraform apply
when:
when:
branch:
- main
event:
- push
image: hashicorp/terraform:1.1.8
commands:
- terraform show -plan .tfplan
# - terraform apply -plan .tfplan -auto-approve