-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add S3/Swift object storage config and other configs from nextcloud/d…
…ocker - Add new S3 test to ci. - Add nextcloud.trustedDomains - Clean up run-test job to test Signed-off-by: jessebot <[email protected]>
- Loading branch information
Showing
14 changed files
with
644 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## minio helm chart values for use in ci tests: | ||
# https://github.com/minio/minio/blob/master/helm/minio/values.yaml | ||
|
||
# make service name predictable | ||
fullnameOverride: minio | ||
|
||
## minio mode, i.e. standalone or distributed | ||
mode: standalone | ||
|
||
## Configure resource requests and limits | ||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/ | ||
resources: | ||
requests: | ||
memory: 1Gi | ||
|
||
## Enable persistence using Persistent Volume Claims | ||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ | ||
persistence: | ||
enabled: false | ||
|
||
# default credentials | ||
rootUser: nextcloud | ||
rootPassword: rootpass123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ jobs: | |
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --target-branch ${{ github.event.repository.default_branch }} | ||
|
||
run-tests: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
needs: [changes, lint] | ||
# only run this job if there are helm chart file changes | ||
|
@@ -82,6 +82,12 @@ jobs: | |
- name: Horizontal Pod Autoscaling Enabled | ||
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 "--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 | ||
uses: actions/checkout@v4 | ||
|
@@ -112,15 +118,43 @@ jobs: | |
uses: helm/[email protected] | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Install MinIO for testing S3 as Primary Storage | ||
if: matrix.test_cases.name == 'S3 Enabled as Primary Storage' | ||
# installs minio community helm chart here: | ||
# https://github.com/minio/minio/tree/master/helm/minio | ||
run: | | ||
helm repo add minio https://charts.min.io/ && \ | ||
helm install minio \ | ||
--namespace nextcloud \ | ||
--create-namespace \ | ||
--wait \ | ||
--wait-for-jobs \ | ||
--timeout 2m0s \ | ||
--values .github/minio_test_values.yaml \ | ||
minio/minio | ||
- name: Run chart-testing (install ${{ matrix.test_cases.name }}) | ||
id: install | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }} | ||
|
||
- 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: | | ||
kubectl config set-context --current --namespace=nextcloud && \ | ||
kubectl apply -f ./.github/test_upload_job.yaml --wait=true && \ | ||
sleep 2 && \ | ||
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 | ||
needs: [changes, run-tests] | ||
needs: [changes, test] | ||
if: always() | ||
steps: | ||
- name: Summary | ||
run: if ${{ needs.changes.outputs.src != 'false' && needs.run-tests.result != 'success' }}; then exit 1; fi | ||
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.