From 8ac2cb13d105a74696f5e58bb56a4803228c4d95 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 20 Sep 2024 17:20:06 +0200 Subject: [PATCH] Add a first version of CI --- .woodpecker/helmfile.yaml | 41 +++++++++++++++++++++++++ charts/roles/templates/sa.yaml | 2 +- values/badhouseplants/values.roles.yaml | 5 +-- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .woodpecker/helmfile.yaml diff --git a/.woodpecker/helmfile.yaml b/.woodpecker/helmfile.yaml new file mode 100644 index 0000000..7183ee7 --- /dev/null +++ b/.woodpecker/helmfile.yaml @@ -0,0 +1,41 @@ +when: + event: + - push +matrix: + include: + - NAME: badhouseplants + ENV: badhouseplants +steps: + test: + image: ghcr.io/helmfile/helmfile:latest + commands: + - kubectl get all -A + backend_options: + kubernetes: + serviceAccountName: woodpecker-ci + resources: + requests: + memory: 500Mi + cpu: 200m + limits: + memory: 500Mi + cpu: 200m + build: + image: ghcr.io/helmfile/helmfile:latest + commands: + - mkdir ~/.kube + - echo $K8S_CONFIG | base64 -d > ~/.kube/config + - helmfile -e "${ENV}" diff + secrets: + - k8s_config + - sops_age_key + backend_options: + kubernetes: + serviceAccountName: woodpecker-ci + resources: + requests: + memory: 500Mi + cpu: 200m + limits: + memory: 500Mi + cpu: 200m diff --git a/charts/roles/templates/sa.yaml b/charts/roles/templates/sa.yaml index ce02cf0..fc554f3 100644 --- a/charts/roles/templates/sa.yaml +++ b/charts/roles/templates/sa.yaml @@ -1,5 +1,5 @@ {{- if .Values.sa }} -{{- range $sa := .Values.roles }} +{{- range $sa := .Values.sa }} --- apiVersion: v1 kind: ServiceAccount diff --git a/values/badhouseplants/values.roles.yaml b/values/badhouseplants/values.roles.yaml index 8d74a12..16dbaee 100644 --- a/values/badhouseplants/values.roles.yaml +++ b/values/badhouseplants/values.roles.yaml @@ -13,11 +13,12 @@ bindings: kind: ClusterRoleBinding subjects: - kind: ServiceAccount - name: pipelines - namespace: woodpecker-ci + namespace: pipelines + name: woodpecker-ci roleRef: kind: ClusterRole name: cluster-admin apiGroup: rbac.authorization.k8s.io sa: - name: woodpecker-ci + namespace: pipelines