mirror of
https://github.com/bvanroll/stage-infra.git
synced 2025-08-28 19:42:43 +00:00
33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
---
|
|
apiVersion: tekton.dev/v1alpha1
|
|
kind: Task #this can be used to deploy a folder aswell as a file, but no replacing the names or versions
|
|
metadata:
|
|
name: deploy-to-cluster
|
|
namespace: tekton-pipeline-1
|
|
spec:
|
|
params:
|
|
- name: yaml-location
|
|
default: infra/
|
|
- name: command
|
|
default: apply
|
|
workspaces:
|
|
- name: source
|
|
mountpath: /source
|
|
results:
|
|
- name: state
|
|
description: state of the next github update
|
|
- name: description
|
|
description: description of the next github updated
|
|
steps:
|
|
- name: deploy-new-app
|
|
image: lachlanevenson/k8s-kubectl
|
|
script: |
|
|
kubectl $(params.command) -f /source/$(params.yaml-location)
|
|
if [ "$?" != 0 ]; then
|
|
printf "failure" > /tekton/results/state
|
|
printf "failure applying yaml file to cluster ($(params.yaml-location))" > /tekton/results/description
|
|
else
|
|
printf "success" > /tekton/results/state
|
|
printf "deployed the yaml files to the cluster"
|
|
fi
|
|
exit 0 |