From d44121975f6f87d73b4e17e2d9fa4a0de9c9a239 Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 1 Dec 2021 12:10:15 +0100 Subject: [PATCH] added setup-docker script --- .../local-integration-test/setup-docker.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/resources/local-integration-test/setup-docker.sh diff --git a/src/test/resources/local-integration-test/setup-docker.sh b/src/test/resources/local-integration-test/setup-docker.sh new file mode 100644 index 0000000..5646c5c --- /dev/null +++ b/src/test/resources/local-integration-test/setup-docker.sh @@ -0,0 +1,18 @@ +docker run -d --privileged --tmpfs /run --tmpfs /var/run --restart always -e K3S_TOKEN=12345678901234 -e K3S_KUBECONFIG_OUTPUT=./kubeconfig.yaml -e K3S_KUBECONFIG_MODE=666 -v k3s-server:/var/lib/rancher/k3s:z -v $(pwd):/output:z -p 6443:6443 -p 80:80 -p 443:443 rancher/k3s server --cluster-init + +export timeout=60; while [ ! -f /var/lib/docker/volumes/k3s-server/_data/server/kubeconfig.yaml ]; do if [ "$timeout" == 0 ]; then echo "ERROR: Timeout while waiting for file."; break; fi; sleep 1; ((timeout--)); done +mkdir -p $HOME/.kube/ + +cp /var/lib/docker/volumes/k3s-server/_data/server/kubeconfig.yaml $HOME/.kube/config + +apk add git curl bash sudo openjdk8 wget +wget -P /etc/apk/keys/ https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub +apk add --no-cache --repository=https://apkproxy.herokuapp.com/sgerrand/alpine-pkg-leiningen leiningen + +curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl +chmod +x ./kubectl +mv ./kubectl /usr/local/bin/kubectl + +git clone https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud.git +cd /c4k-nextcloud && git checkout local-integration-test +cd /c4k-nextcloud/src/test/resources/local-integration-test && ./setup-local-s3-on-k3d.sh \ No newline at end of file