Skip to content

Commit

Permalink
chore(nextcloud): switch to helm-docs
Browse files Browse the repository at this point in the history
Signed-off-by: WrenIX <[email protected]>
  • Loading branch information
wrenix committed Dec 27, 2024
1 parent be60e91 commit 0e73f93
Show file tree
Hide file tree
Showing 11 changed files with 376 additions and 1,061 deletions.
26 changes: 26 additions & 0 deletions .github/tests/test_upload_job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: create-nextcloud-file
namespace: nextcloud
spec:
template:
metadata:
name: create-nextcloud-file
spec:
containers:
- name: create-nextcloud-file
image: curlimages/curl
command:
- /bin/sh
- -c
- |
echo "testing123" > test_upload.txt && \
curl \
-w "%{http_code}" \
-u admin:changeme \
-T test_upload.txt \
"http://nextcloud.nextcloud.svc.cluster.local:8080/remote.php/dav/files/admin/test_upload.txt" && \
echo -e "\nTried to uploaded a file, test_upload.txt, to Nextcloud."
restartPolicy: Never
38 changes: 14 additions & 24 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add collabora-online https://collaboraonline.github.io/online
- name: Set up chart-testing
uses: helm/[email protected]
Expand All @@ -58,7 +57,7 @@ jobs:
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

test:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
needs: [changes, lint]
# only run this job if there are helm chart file changes
if: needs.changes.outputs.src != 'false'
Expand All @@ -73,27 +72,21 @@ jobs:

# test the helm chart with postgresql subchart enabled
- name: PostgreSQL Enabled
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/postgresql.yaml"'
helm_args: '--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing12345"'

# test the helm chart with nginx container enabled
- name: Nginx Enabled
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/nginx.yaml"'
helm_args: '--helm-extra-set-args "--set=image.flavor=fpm --set=nginx.enabled=true"'

# test the helm chart with horizontal pod autoscaling enabled
- name: Horizontal Pod Autoscaling Enabled
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/hpa.yaml"'
helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"'

# test the helm chart with s3 as the primary storage
- name: S3 Enabled as Primary Storage
# we need to skip the clean up so we can test adding a file
helm_args: |
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--values charts/nextcloud/test-values/s3-as-primary-storage.yaml"
test: true

# test the helm chart with imaginary
- name: Imaginary Enabled
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
test: true
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--set=fullnameOverride=nextcloud --set=nextcloud.objectStore.s3.enabled=true --set=nextcloud.objectStore.s3.accessKey=nextcloud --set=nextcloud.objectStore.s3.secretKey=rootpass123 --set=nextcloud.objectStore.s3.host=minio.nextcloud.svc.cluster.local --set=nextcloud.objectStore.s3.port=9000 --set=nextcloud.objectStore.s3.ssl=false --set=nextcloud.objectStore.s3.bucket=nextcloud --set=nextcloud.objectStore.s3.usePathStyle=true --set=image.flavor=fpm --set=nginx.enabled=true --set=nextcloud.host=nextcloud --set=nextcloud.trustedDomains[0]='*'"
steps:
- name: Checkout
Expand All @@ -109,7 +102,6 @@ jobs:
- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add collabora-online https://collaboraonline.github.io/online
- name: Set up chart-testing
uses: helm/[email protected]
Expand All @@ -123,7 +115,7 @@ jobs:
fi
- name: Create kind cluster
uses: helm/kind-action@v1.11.0
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'

- name: Install MinIO for testing S3 as Primary Storage
Expand All @@ -146,20 +138,18 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }}

- name: Run test for Nextcloud
if: matrix.test_cases.test
- name: Try adding a file to Nextcloud
if: matrix.test_cases.name == 'S3 Enabled as Primary Storage'
# applies a kubernetes job that uploads a file and then checks log of finished pod
run: |
EXIT=0
kubectl config set-context --current --namespace=nextcloud && \
kubectl apply -f ./.github/tests/test_job.yaml --wait=true && \
kubectl apply -f ./.github/tests/test_upload_job.yaml --wait=true && \
sleep 2 && \
kubectl wait --for=condition=Complete --timeout=2m job/test-nextcloud || EXIT=1
echo "Here's the logs from the job:"
kubectl logs --ignore-errors --prefix --tail=-1 --all-containers=true -l batch.kubernetes.io/job-name=test-nextcloud
echo "Here's the logs from the nextcloud pod:"
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
exit $EXIT
kubectl wait --for=condition=Complete --timeout=2m job/create-nextcloud-file && \
echo "Here's the logs from the job:" && \
kubectl logs --tail=-1 -f -l batch.kubernetes.io/job-name=create-nextcloud-file && \
echo "Here's the logs from the nextcloud pod:" && \
kubectl logs -l app.kubernetes.io/name=nextcloud
summary:
runs-on: ubuntu-latest-low
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add collabora https://collaboraonline.github.io/online/
- name: Run chart-releaser
uses: helm/[email protected]
Expand Down
9 changes: 3 additions & 6 deletions charts/nextcloud/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ dependencies:
version: 18.2.0
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 19.6.4
- name: collabora-online
repository: https://collaboraonline.github.io/online
version: 1.1.20
digest: sha256:00e8d82d28825fd3f46e7e7d888d1aac93ebdb5135f6a4d7e6ae0c3155881c27
generated: "2024-12-15T19:47:53.357052+01:00"
version: 19.5.0
digest: sha256:4efc098feeb7f4486b7166f1c71b9c54bfee0797663a3339f379d397297303c7
generated: "2024-06-03T09:51:56.321676+02:00"
28 changes: 14 additions & 14 deletions charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
apiVersion: v2
name: nextcloud
version: 6.5.0
appVersion: 30.0.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
- nextcloud
- storage
- http
- web
- php
home: https://nextcloud.com/
icon: https://cdn.rawgit.com/docker-library/docs/defa5ffc7123177acd60ddef6e16bddf694cc35f/nextcloud/logo.svg
sources:
Expand All @@ -21,6 +13,19 @@ maintainers:
email: [email protected]
- name: billimek
email: [email protected]
- name: WrenIX
url: https://wrenix.eu
- name: jessebot
url: https://jessebot.work
keywords:
- nextcloud
- storage
- http
- web
- php
version: 6.0.2
# renovate: image=docker.io/library/nextcloud
appVersion: 30.0.0
dependencies:
- name: postgresql
version: 15.5.0
Expand All @@ -31,11 +36,6 @@ dependencies:
repository: oci://registry-1.docker.io/bitnamicharts
condition: mariadb.enabled
- name: redis
version: 19.6.4
version: 19.5.0
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled
- name: collabora-online
version: 1.1.20
repository: https://collaboraonline.github.io/online
condition: collabora.enabled
alias: collabora
Loading

0 comments on commit 0e73f93

Please sign in to comment.