khuedoan-homelab/.tekton/external.yaml

43 lines
919 B
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: terraform-external
spec:
workspaces:
- name: source
stepTemplate:
image: hashicorp/terraform:1.1.2
workingDir: /workspace/source/external
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
volumes:
- name: terraform-secrets
secret:
secretName: terraform-secrets
steps:
- name: lint
args:
- fmt
- -recursive
- -diff
- -check
- name: init
args:
- init
- name: plan
args:
- plan
- -out=tfplan
- name: apply
args:
- apply
- -auto-approve
- tfplan