diff --git a/src/test/resources/local-integration-test/README.md b/src/test/resources/local-integration-test/README.md index 8853671..fe33ede 100644 --- a/src/test/resources/local-integration-test/README.md +++ b/src/test/resources/local-integration-test/README.md @@ -47,16 +47,7 @@ Some of the steps may take some min to be effective, but eventually nextcloud sh k3d is a k3s system which is running inside of a container. To install k3d run `curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash` or have a look at https://k3d.io/v5.0.3/ . -* Start a k3d cluster and deploy s3 on it: `./setup-local-s3-on-k3d.sh` -* Create and deploy the c4k yaml for nextcloud (incl. postgres etc): -`java -jar target/uberjar/c4k-nextcloud-standalone.jar valid-config.edn valid-auth.edn | kubectl apply -f -` -* With `kubectl get ingress` you can view the ingress' ip (e.g. 10.0.2.15), add (resp. change if already existing) a line to file "/etc/hosts" e.g. `10.0.2.15 k3stesthost cloudhost` -* you can also use `kubectl get ingress ingress-localstack -o jsonpath="{.status.loadBalancer.ingress[0].ip}"` -* Scale the backup-restore pod to one replica with `kubectl scale deployment backup-restore --replicas 1` -* connect onto the newly created pod with `kubectl exec -it backup-restore -- bash` -* add the ingress ip to /etc/hosts on the pod -* copy the certificate file `ca.crt` to the pod and set the environment variable `$CERTIFICATE_FILE` to its path -* test the scripts in /usr/local/bin first `init.sh` then `backup.sh` and `restore.sh` +* Start a k3d cluster to deploy s3, nextcloud and test backup and restore on it: `./setup-local-s3-on-k3d.sh` Some of the steps may take some min to be effective, but eventually nextcloud should be available at: https://cloudhost diff --git a/src/test/resources/local-integration-test/setup-local-s3-on-k3d.sh b/src/test/resources/local-integration-test/setup-local-s3-on-k3d.sh index d81f715..eb2e54a 100755 --- a/src/test/resources/local-integration-test/setup-local-s3-on-k3d.sh +++ b/src/test/resources/local-integration-test/setup-local-s3-on-k3d.sh @@ -38,11 +38,11 @@ function main() echo POD=$(kubectl get pod -l app=backup-restore -o name) - kubectl wait $POD --for=condition=Ready + kubectl wait $POD --for=condition=Ready --timeout=120s kubectl exec -t $POD -- bash -c "echo \"$ENDPOINT k3stesthost cloudhost\" >> /etc/hosts" kubectl exec -t $POD -- /usr/local/bin/init.sh kubectl exec -t $POD -- /usr/local/bin/backup.sh - + kubectl exec -t $POD -- /usr/local/bin/restore.sh } main $@