khuedoan-homelab/.tekton/tasks/external.yaml

37 lines
822 B
YAML
Raw Normal View History

2021-12-24 13:35:41 +07:00
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: terraform-external
spec:
workspaces:
- name: source
2021-12-24 13:35:41 +07:00
stepTemplate:
image: hashicorp/terraform:1.1.4
workingDir: /workspace/source/external
2021-12-24 13:35:41 +07:00
volumeMounts:
- name: terraform-secrets
mountPath: /root/.terraform.d/credentials.tfrc.json
subPath: credentials.tfrc.json
- name: terraform-secrets
mountPath: /workspace/source/external/terraform.tfvars
subPath: terraform.tfvars
command:
- terraform
2021-12-24 13:35:41 +07:00
volumes:
- name: terraform-secrets
2021-12-24 13:35:41 +07:00
secret:
secretName: terraform-secrets
2021-12-24 13:35:41 +07:00
steps:
- name: init
args:
- init
- name: plan
args:
- plan
- -out=tfplan
2021-12-24 13:35:41 +07:00
- name: apply
args:
- apply
- -auto-approve
- tfplan