ci: use proxy/load graphql

This commit is contained in:
Alessandro Pezzè 2021-05-28 17:06:06 +02:00
parent d5629937a2
commit faa5c75ac0
2 changed files with 26 additions and 26 deletions

View file

@ -1,4 +1,4 @@
name: docker-image
name: Build and Push Docker image
on:
push:
@ -12,34 +12,28 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
-
name: Docker meta
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
pokeapi/pokeapi
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }}
password: ${{ secrets.DOCKERHUB_TOKEN_NARAMSIM }}
-
name: Build and push
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
@ -48,6 +42,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Image digest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -1,4 +1,4 @@
name: kustomize
name: Deploy Kustomize k8s cluster
on:
push:
@ -7,7 +7,7 @@ on:
- 'staging'
jobs:
create-cluster:
create-kustomize-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -18,17 +18,24 @@ jobs:
uses: helm/kind-action@v1.1.0
with:
version: v0.11.1
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Test
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
- name: K8s Apply
run: |
kubectl cluster-info
kubectl get storageclass standard
cp Resources/k8s/kustomize/secrets/postgres.env.sample Resources/k8s/kustomize/secrets/postgres.env
make kustomize-apply
bash Resources/scripts/wait.sh http://localhost/api/v2/
kubectl proxy &
bash Resources/scripts/wait.sh http://localhost:8001/api/v1/namespaces/pokeapi/services/pokeapi/proxy/api/v2/
- name: Migrate and build data
run: |
make k8s-migrate
make k8s-build-db
bash Resources/scripts/wait.sh http://localhost/api/v2/pal-park-area/5/
bash Resources/scripts/wait.sh http://localhost:8001/api/v1/namespaces/pokeapi/services/pokeapi/proxy/api/v2/pal-park-area/5/
- name: K8s Apply
run: |
kubectl apply -f Resources/k8s/kustomize/jobs/load-graphql.yml
kubectl wait --timeout=120s --for=condition=complete job/load-graphql
last_command=$(kubectl get job -o jsonpath='{.status.succeeded}' load-graphql)
test "$last_command" -eq 1