From 92e8671b8eb0443d7921209cd191e91dbd365b85 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 3 Jun 2024 05:43:53 +0200 Subject: [PATCH] test: checkout object --- .github/workflows/docker-k8s.yml | 2 +- Resources/k8s/kustomize/base/config/pokeapi.env.sample | 1 + Resources/k8s/kustomize/base/jobs/load-graphql.yaml | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-k8s.yml b/.github/workflows/docker-k8s.yml index 75a8f788..35583ae8 100644 --- a/.github/workflows/docker-k8s.yml +++ b/.github/workflows/docker-k8s.yml @@ -98,6 +98,6 @@ jobs: bash Resources/scripts/wait.sh http://localhost:8001/api/v1/namespaces/pokeapi/services/pokeapi/proxy/api/v2/pal-park-area/5/ - name: K8s wait for job run: | - kubectl wait --timeout=120s --for=condition=complete job/load-graphql + kubectl wait --timeout=1020s --for=condition=complete job/load-graphql last_command=$(kubectl get job -o jsonpath='{.status.succeeded}' load-graphql) test "$last_command" -eq 1 diff --git a/Resources/k8s/kustomize/base/config/pokeapi.env.sample b/Resources/k8s/kustomize/base/config/pokeapi.env.sample index e964f3cf..76fb7424 100644 --- a/Resources/k8s/kustomize/base/config/pokeapi.env.sample +++ b/Resources/k8s/kustomize/base/config/pokeapi.env.sample @@ -1,2 +1,3 @@ ADMINS=PokeAPI,change.me@pokeapi.co BASE_URL=http://localhost/ +POKEAPI_CHECKOUT_REF=master \ No newline at end of file diff --git a/Resources/k8s/kustomize/base/jobs/load-graphql.yaml b/Resources/k8s/kustomize/base/jobs/load-graphql.yaml index 1674318f..b71fb3ac 100644 --- a/Resources/k8s/kustomize/base/jobs/load-graphql.yaml +++ b/Resources/k8s/kustomize/base/jobs/load-graphql.yaml @@ -25,13 +25,15 @@ spec: secretKeyRef: name: graphql-env-secret key: HASURA_GRAPHQL_ADMIN_SECRET + envFrom: + - configMapRef: + name: pokeapi-configmap command: ["sh", "-c"] args: - apt-get update && apt-get install -y git curl && - curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash && - hasura update-cli --version v2.36.4 && + curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.36.4 bash && git clone https://github.com/PokeAPI/pokeapi.git && cd pokeapi && - git checkout staging && + git checkout $(POKEAPI_CHECKOUT_REF) | git checkout master && hasura md apply --endpoint http://graphql:8080 --project graphql --admin-secret $(HASURA_GRAPHQL_ADMIN_SECRET)