ci: add drone.yml
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
45
.drone.yml
Normal file
45
.drone.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
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 700 ~/.ssh
|
||||
- "echo $${CI_SSH_KEY} > ~/.ssh/id_rsa"
|
||||
- chmod 600 ~/.ssh/id_rsa"
|
||||
- ssh-keyscan git.thomasklein.me
|
||||
environment:
|
||||
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 apply -plan .tfplan -auto-approve
|
||||
Reference in New Issue
Block a user