Files
terraform-app-drone/.drone.yml
Tamas Kiss e03dfa55a9
Some checks failed
continuous-integration/drone/push Build is failing
ci: add drone.yml
2022-05-26 03:22:36 +02:00

51 lines
1006 B
YAML

---
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
- echo -n "Host *\n StrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-keyscan -t rsa git.thomasklein.me >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- env
- cat ~/.netrc
- "false"
environment:
CI_SSH_KEY: "YWxtYWZhCg=="
# 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 apply -plan .tfplan -auto-approve