Compare commits

..

6 Commits

Author SHA1 Message Date
e46e008941 Updated
All checks were successful
Upload Helm Chart / Explore-Gitea-Actions (push) Successful in 2s
2024-01-06 11:27:03 +01:00
e5c2275912 Updated
All checks were successful
Upload Helm Chart / Explore-Gitea-Actions (push) Successful in 2s
2024-01-06 11:19:35 +01:00
fbbff9d1f3 Updated
All checks were successful
Upload Helm Chart / Explore-Gitea-Actions (push) Successful in 2s
2024-01-06 11:15:31 +01:00
4a26a60ab8 Updated
All checks were successful
Upload Helm Chart / Explore-Gitea-Actions (push) Successful in 2s
2024-01-06 11:13:50 +01:00
8a217d5e65 Updated
All checks were successful
Upload Helm Chart / Explore-Gitea-Actions (push) Successful in 4s
2024-01-06 11:10:24 +01:00
931d43f1a4 Updated
Some checks are pending
Upload Helm Chart / Explore-Gitea-Actions (push) Waiting to run
2024-01-06 11:09:36 +01:00
4 changed files with 140 additions and 10 deletions

View File

@@ -1,14 +1,12 @@
name: Upload Helm Chart name: Upload Helm Chart
run-name: Uploading helm chart run-name: Uploading helm chart
on: on: [push]
push:
tags: ['*']
jobs: jobs:
Explore-Gitea-Actions: Explore-Gitea-Actions:
runs-on: shell runs-on: shell
env: env:
HELM_CHART_VERSION: "${{ github.ref_name }}" HELM_CHART_VERSION: "1.0.24"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Helm - name: Set up Helm
@@ -17,6 +15,7 @@ jobs:
version: 'v3.0.0' version: 'v3.0.0'
- run: 'sed -i "s/version:.*/version: \"${HELM_CHART_VERSION}\"/" ./Chart/Chart.yaml' - run: 'sed -i "s/version:.*/version: \"${HELM_CHART_VERSION}\"/" ./Chart/Chart.yaml'
- run: helm package ./Chart - run: helm package ./Chart
- run: echo ${{ secrets.GITEA_TOKEN }} > /tmp/gitea-token
- name: Upload Helm Chart - name: Upload Helm Chart
run: | run: |
curl --request POST \ curl --request POST \

2
.gitignore vendored
View File

@@ -1,4 +1,2 @@
example.yaml example.yaml
example*.yaml example*.yaml
example*.yml
test-*.yaml

View File

@@ -1,5 +1,5 @@
variables: variables:
HELM_CHART_VERSION: "1.0.24" HELM_CHART_VERSION: "0.6.13"
stages: stages:
- deploy - deploy
@@ -9,7 +9,9 @@ default:
name: cloudyne/kubectl-helm:latest name: cloudyne/kubectl-helm:latest
entrypoint: [""] entrypoint: [""]
tags: tags:
- shell - build01
- helm
- chartbuild
deploy: deploy:
stage: deploy stage: deploy

131
Chart/templates/job.yaml Normal file
View File

@@ -0,0 +1,131 @@
{{- if .Values.init.asJob }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "..fullname" . }}-initializer
labels:
{{- include "..labels" . | nindent 4 }}
cloudyne.systems/component: site-init
spec:
backoffLimit: 2
template:
spec:
restartPolicy: "OnFailure"
affinity: {{ include "..affinity-labels" . | nindent 8 }}
securityContext:
fsGroup: 101
volumes:
- name: serverconfig
configMap:
name: {{ include "..fullname" . }}-cfg
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "file" }}
- name: {{ .name }}
secret:
secretName: {{- include "..fullname" $ }}-exts-{{ .name }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.kubernetes }}
{{- range .Values.storage.kubernetes }}
- name: {{ .name }}
{{- if eq .type "secret" }}
secret:
secretName: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- if eq .type "configmap" }}
configMap:
name: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.cloud.active }}
- name: cloud
persistentVolumeClaim:
claimName: pvc-{{- include "..name" . }}-cloud
{{- end }}
{{- if .Values.storage.local.active }}
- name: local
persistentVolumeClaim:
claimName: pvc-{{- include "..name" . }}-local
{{- end }}
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "docker" }}
imagePullSecrets:
- name: "{{- include "..fullname" $ }}-exts-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.kubernetes }}
{{- range .Values.storage.kubernetes }}
{{- if eq .type "docker" }}
imagePullSecrets:
- name: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.storage.cloud.active .Values.storage.local.active .Values.storage.local.cloneCloud }}
initContainers:
- name: init-local-storage
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
image: cloudyne/ubuntu-ci:latest
command: ["python3"]
args: ["/usr/local/bin/storage-clone", "/mnt/cloud", "/mnt/local"]
imagePullPolicy: IfNotPresent
volumeMounts:
- name: cloud
mountPath: /mnt/cloud
- name: local
mountPath: /mnt/local
{{- end }}
containers:
- name: init-site
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
image: "{{ .Values.site.image }}"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: serverconfig
mountPath: /init-go/config.json
subPath: init.json
{{- if .Values.storage.local.active }}
{{- range .Values.storage.folders }}
- name: local
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
{{- end }}
{{- if .Values.storage.cloud.active }}
- name: cloud
mountPath: "/mnt/cloud"
{{- end }}
{{- else }}
{{- if .Values.storage.cloud.active }}
{{- range .Values.storage.folders }}
- name: cloud
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
{{- end }}
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "env" }}
- secretRef:
name: "{{- include "..fullname" $ }}-exts-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
- secretRef:
name: {{ include "..fullname" . }}-db-auth
command: ["sh"]
args: ["-c", "/init-go/init-go"]
{{- end }}