2024-04-02 17:15:40 +00:00
|
|
|
---
|
|
|
|
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 \
|
2024-05-04 16:42:28 +00:00
|
|
|
| yq '.data.value' \
|
2024-04-02 17:15:40 +00:00
|
|
|
| base64 -d > /tmp/outputs/config
|
|
|
|
chmod 0600 /tmp/outputs/config
|
2024-04-29 13:46:52 +00:00
|
|
|
- name: annonate-an-env-cm-installing
|
2024-04-06 17:56:56 +00:00
|
|
|
image: alpine/k8s:1.29.2
|
|
|
|
script: |-
|
|
|
|
#!/bin/sh
|
|
|
|
kubectl annotate --overwrite configmap \
|
|
|
|
"$(params.environment)" \
|
|
|
|
--namespace "$(params.namespace)" \
|
|
|
|
"softplayer.net/status=installing-dependencies"
|
2024-05-08 15:38:52 +00:00
|
|
|
- name: get-yq
|
|
|
|
image: mikefarah/yq
|
|
|
|
script: |-
|
|
|
|
#!/bin/sh
|
|
|
|
cp $(which yq) /tmp/outputs/yq
|
2024-04-02 17:15:40 +00:00
|
|
|
- name: deploy-helmfile
|
|
|
|
image: ghcr.io/helmfile/helmfile:v0.163.1
|
|
|
|
env:
|
|
|
|
- name: KUBECONFIG
|
|
|
|
value: /tmp/outputs/config
|
|
|
|
script: |-
|
|
|
|
#!/bin/sh
|
2024-05-08 15:38:52 +00:00
|
|
|
cp /tmp/outputs/yq /usr/bin/yq
|
2024-04-02 17:15:40 +00:00
|
|
|
mkdir -p /src
|
|
|
|
git clone https://git.badhouseplants.net/softplayer/softplayer-helmfile.git /src/helmfile
|
|
|
|
cd /src/helmfile/workload && helmfile sync
|
2024-04-29 13:46:52 +00:00
|
|
|
- name: annonate-an-env-cm-ready
|
2024-04-06 17:56:56 +00:00
|
|
|
image: alpine/k8s:1.29.2
|
|
|
|
script: |-
|
|
|
|
#!/bin/sh
|
|
|
|
kubectl annotate --overwrite configmap \
|
|
|
|
"$(params.environment)" \
|
|
|
|
--namespace "$(params.namespace)" \
|
|
|
|
"softplayer.net/status=ready"
|
2024-04-02 17:15:40 +00:00
|
|
|
workspaces:
|
|
|
|
- name: outputs
|
|
|
|
description: A folder to store outputs
|
|
|
|
optional: false
|
|
|
|
mountPath: /tmp/outputs
|