diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7b75cb5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +variables: + HELM_CHART_VERSION: "0.5.1" + +stages: + - deploy + +default: + image: cloudyne/kubectl-helm:latest + tags: + - kubernetes + - cluster01 + +deploy: + stage: deploy + script: + - 'sed -i "s/version:.*/version: ${HELM_CHART_VERSION}/"' + - helm package ./Chart + - | + curl --request POST \ + --user gitlab-ci-token:$CI_JOB_TOKEN \ + --form "chart=@cloudypress-${HELM_CHART_VERSION}.tgz" \ + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' diff --git a/chart/disabled-templates/resourcequota.yaml b/Chart/.disabled-templates/resourcequota.yaml similarity index 100% rename from chart/disabled-templates/resourcequota.yaml rename to Chart/.disabled-templates/resourcequota.yaml diff --git a/chart/.helmignore b/Chart/.helmignore similarity index 100% rename from chart/.helmignore rename to Chart/.helmignore diff --git a/chart/Chart.yaml b/Chart/Chart.yaml similarity index 89% rename from chart/Chart.yaml rename to Chart/Chart.yaml index 501b5e7..27e62af 100644 --- a/chart/Chart.yaml +++ b/Chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: cloudypress description: A helm chart for deploying Wordpress on Cloudyne Hosting type: application -version: 0.1.5 +version: "0.5.0" appVersion: "6.1.1" diff --git a/chart/README.md b/Chart/README.md similarity index 100% rename from chart/README.md rename to Chart/README.md diff --git a/chart/templates/NOTES.txt b/Chart/templates/NOTES.txt similarity index 100% rename from chart/templates/NOTES.txt rename to Chart/templates/NOTES.txt diff --git a/chart/templates/_helpers.tpl b/Chart/templates/_helpers.tpl similarity index 100% rename from chart/templates/_helpers.tpl rename to Chart/templates/_helpers.tpl diff --git a/chart/templates/certificate.yaml b/Chart/templates/certificate.yaml similarity index 100% rename from chart/templates/certificate.yaml rename to Chart/templates/certificate.yaml diff --git a/chart/templates/configmap.yaml b/Chart/templates/configmap.yaml similarity index 98% rename from chart/templates/configmap.yaml rename to Chart/templates/configmap.yaml index 5354cfb..f0400ee 100644 --- a/chart/templates/configmap.yaml +++ b/Chart/templates/configmap.yaml @@ -10,8 +10,11 @@ data: SMTP_FORCE_FROM: "noreply@customer.v3.nu" SMTP_FROM_NAME: "V3 Customer Mailer" WP_ENV: "production" - WP_HOME: {{ .Values.site.url }} - WP_SITEURL: {{ .Values.site.url }}/wp + {{- if .Values.site.overrideMainUrl }} + WP_HOME: "https://{{ .Values.site.overrideMainUrl }}" + {{- else }} + WP_HOME: "https://{{ .Values.site.url }}" + {{- end }} {{- if and .Values.site.init .Values.site.init.composerPackage }} RUN_COMPOSER: 'true' diff --git a/chart/templates/database.yaml b/Chart/templates/database.yaml similarity index 100% rename from chart/templates/database.yaml rename to Chart/templates/database.yaml diff --git a/chart/templates/deployment.yaml b/Chart/templates/deployment.yaml similarity index 94% rename from chart/templates/deployment.yaml rename to Chart/templates/deployment.yaml index 5812eb7..ecf667b 100644 --- a/chart/templates/deployment.yaml +++ b/Chart/templates/deployment.yaml @@ -59,13 +59,13 @@ spec: - secretRef: name: {{ include "..fullname" . }}-db-auth - secretRef: - name: global-secrets-ext + name: global-secrets containers: - name: wordpress securityContext: runAsUser: 65534 {{- if .Values.global }} - image: {{ .Values.global.initImage | default "ghcr.io/cloudynes/php-nginx" }}:{{ .Values.global.imagetag | default "latest" }} + image: {{ .Values.global.serverImage | default "ghcr.io/cloudynes/php-nginx" }}:{{ .Values.global.imagetag | default "latest" }} {{- else }} image: ghcr.io/cloudynes/php-nginx:latest {{- end }} @@ -78,6 +78,7 @@ spec: subPath: nginx.conf - name: serverconfig mountPath: /usr/local/etc/php-fpm.d/www.conf + subPath: www.conf {{- if and .Values.site .Values.site.storage .Values.site.storage.cloud .Values.site.storage.cloud.folders }} {{- range $v := .Values.site.storage.cloud.folders }} - name: cloud @@ -91,7 +92,7 @@ spec: - secretRef: name: {{ include "..fullname" . }}-db-auth - secretRef: - name: global-secrets-ext + name: global-secrets resources: {{- if and .Values.customer .Values.customer.package .Values.customer.package.cpu }} requests: diff --git a/chart/templates/externalsecret.yaml b/Chart/templates/externalsecret.yaml similarity index 100% rename from chart/templates/externalsecret.yaml rename to Chart/templates/externalsecret.yaml diff --git a/chart/templates/ingress.yaml b/Chart/templates/ingress.yaml similarity index 100% rename from chart/templates/ingress.yaml rename to Chart/templates/ingress.yaml diff --git a/chart/templates/persistentvolume.yaml b/Chart/templates/persistentvolume.yaml similarity index 90% rename from chart/templates/persistentvolume.yaml rename to Chart/templates/persistentvolume.yaml index bde11de..16d88bd 100644 --- a/chart/templates/persistentvolume.yaml +++ b/Chart/templates/persistentvolume.yaml @@ -17,8 +17,8 @@ spec: volumeAttributes: containername: {{ .Values.site.storage.cloud.container }} csi.storage.k8s.io/pv/name: pv-{{ include "..fullname" . }} - csi.storage.k8s.io/pvc/namespace: {{ .Values.customer.name }} - secretnamespace: {{ .Values.customer.name }} + csi.storage.k8s.io/pvc/namespace: {{ include "..fullname" . }} + secretnamespace: {{ include "..fullname" . }} skuName: {{ .Values.site.storage.cloud.type }} volumeHandle: {{ .Values.site.storage.cloud.class }}-retain_{{ include "..fullname" . }} mountOptions: diff --git a/chart/templates/persistentvolumeclaim.yaml b/Chart/templates/persistentvolumeclaim.yaml similarity index 80% rename from chart/templates/persistentvolumeclaim.yaml rename to Chart/templates/persistentvolumeclaim.yaml index ec507a9..ad227d5 100644 --- a/chart/templates/persistentvolumeclaim.yaml +++ b/Chart/templates/persistentvolumeclaim.yaml @@ -9,11 +9,14 @@ metadata: {{- include "..labels" . | nindent 8 }} name: pvc-{{ include "..fullname" . }} spec: + volumeMode: Filesystem + volumeName: pv-{{ include "..fullname" . }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.customer.package.disk }} + +{{- if and .Values.site .Values.site.storage .Values.site.storage.cloud }} storageClassName: {{ .Values.site.storage.cloud.class }}-retain - volumeMode: Filesystem - volumeName: pv-{{ include "..fullname" . }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/chart/templates/service.yaml b/Chart/templates/service.yaml similarity index 100% rename from chart/templates/service.yaml rename to Chart/templates/service.yaml diff --git a/chart/templates/tests/site-live.yaml b/Chart/templates/tests/site-live.yaml similarity index 100% rename from chart/templates/tests/site-live.yaml rename to Chart/templates/tests/site-live.yaml diff --git a/chart/values.yaml b/Chart/values.yaml similarity index 99% rename from chart/values.yaml rename to Chart/values.yaml index d671459..a9dc390 100644 --- a/chart/values.yaml +++ b/Chart/values.yaml @@ -95,7 +95,7 @@ global: initImage: ghcr.io/cloudynes/php-init # The tag to use for the above images - imageTag: latest + imageTag: fpm8.0-alpine3.16 # The database instance where the database will be provisioned dbInstance: "kincaid" diff --git a/cloudypress-0.5.0.tgz b/cloudypress-0.5.0.tgz new file mode 100644 index 0000000..119c724 Binary files /dev/null and b/cloudypress-0.5.0.tgz differ