From 90cebdb7a68dbbc4c84b9c871807a602b0808128 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 16 Jan 2024 16:16:07 -0700 Subject: [PATCH] Add CI script for k8s deployment test (#705) --- .gitea/workflows/test-k8s-deploy.yml | 15 ++++++--------- tests/scripts/install-kind.sh | 5 +++++ tests/scripts/install-kubectl.sh | 5 +++++ 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100755 tests/scripts/install-kind.sh create mode 100755 tests/scripts/install-kubectl.sh diff --git a/.gitea/workflows/test-k8s-deploy.yml b/.gitea/workflows/test-k8s-deploy.yml index 84cce91a..2856d403 100644 --- a/.gitea/workflows/test-k8s-deploy.yml +++ b/.gitea/workflows/test-k8s-deploy.yml @@ -44,12 +44,9 @@ jobs: - name: Start dockerd # Also needed until we can incorporate into the executor run: | dockerd -H $DOCKER_HOST --userland-proxy=false & - sleep 5 - - name: "Install Go" - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - name: "Install Kind" - run: go install sigs.k8s.io/kind@v0.20.0 - - name: "Debug Kind" - run: kind create cluster --retain && docker logs kind-control-plane + - name: "Install kind" + run: ./tests/scripts/install-kind.sh + - name: "Install Kubectl" + run: ./tests/scripts/install-kubectl.sh + - name: "Run k8s deployment test" + run: ./tests/k8s-deploy/run-deploy-test.sh diff --git a/tests/scripts/install-kind.sh b/tests/scripts/install-kind.sh new file mode 100755 index 00000000..254c3288 --- /dev/null +++ b/tests/scripts/install-kind.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# TODO: handle ARM +curl --silent -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 +chmod +x ./kind +mv ./kind /usr/local/bin diff --git a/tests/scripts/install-kubectl.sh b/tests/scripts/install-kubectl.sh new file mode 100755 index 00000000..7a5062fe --- /dev/null +++ b/tests/scripts/install-kubectl.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# TODO: handle ARM +curl --silent -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" +chmod +x ./kubectl +mv ./kubectl /usr/local/bin