40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
---
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: deploy-helmfile-base
|
|
namespace: {{ .Values.pipelineNamespace }}
|
|
labels:
|
|
{{- include "tekton-pipelines.labels" . | nindent 4 }}
|
|
spec:
|
|
params:
|
|
- name: namespace
|
|
type: string
|
|
- name: environment
|
|
type: string
|
|
steps:
|
|
- name: get-ssh-key
|
|
image: alpine/k8s:1.29.2
|
|
script: |-
|
|
#!/bin/sh
|
|
kubectl get secret "$(params.environment)"-config \
|
|
--namespace "$(params.namespace)" -o yaml \
|
|
| yq '.data.kubeconfig' \
|
|
| base64 -d > /tmp/outputs/config
|
|
chmod 0600 /tmp/outputs/config
|
|
- name: deploy-helmfile
|
|
image: ghcr.io/helmfile/helmfile:v0.163.1
|
|
env:
|
|
- name: KUBECONFIG
|
|
value: /tmp/outputs/config
|
|
script: |-
|
|
#!/bin/sh
|
|
mkdir -p /src
|
|
git clone https://git.badhouseplants.net/softplayer/softplayer-helmfile.git /src/helmfile
|
|
cd /src/helmfile/workload && helmfile sync
|
|
workspaces:
|
|
- name: outputs
|
|
description: A folder to store outputs
|
|
optional: false
|
|
mountPath: /tmp/outputs
|