Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(prefix): add prefix to api routes #197

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/test-on-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:
wait: 60s
verbosity: 2

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2

- name: Set up ingress controller
run: |
helm repo add traefik https://traefik.github.io/charts && helm repo update
Expand All @@ -50,17 +45,17 @@ jobs:
run: |
TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build
kind load docker-image \
basegun-backend:$(make get-current-tag)-prod \
basegun-frontend:$(make get-current-tag)-prod \
basegun-backend:$(make get-current-tag) \
basegun-frontend:$(make get-current-tag) \
--name basegun-testing
helm upgrade --install basegun ./infra/kube/helm/ \
--set ingress.hosts[0].host="$LOCAL_DOMAIN" \
--set ingress.hosts[0].paths[0].path="/" \
--set ingress.hosts[0].paths[0].pathType="Prefix" \
--set backend.image.repository="basegun-backend" \
--set backend.image.tag="$(make get-current-tag)-prod" \
--set backend.image.tag="$(make get-current-tag)" \
--set frontend.image.repository="basegun-frontend" \
--set frontend.image.tag="$(make get-current-tag)-prod" \
--set frontend.image.tag="$(make get-current-tag)" \
--set backend.secret.create="true" \
--set-string backend.secret.values.AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}" \
--set-string backend.secret.values.AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}" \
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- WORKSPACE=${WORKSPACE:-prod}
image: basegun-backend:${TAG}-prod
image: basegun-backend:${TAG}
ports:
- 5000:5000

Expand All @@ -23,6 +23,6 @@ services:
context: ./frontend
target: prod
container_name: basegun-frontend
image: basegun-frontend:${TAG}-prod
image: basegun-frontend:${TAG}
ports:
- ${PORT_PROD:-80}:8080
33 changes: 33 additions & 0 deletions infra/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# Launch a cluster like the one in CI
kind delete cluster

TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build
kind create cluster --config ./infra/kube/kind/kind-config.yml

helm repo add traefik https://traefik.github.io/charts && helm repo update
helm upgrade \
--install \
--wait \
--namespace traefik \
--create-namespace \
--values ./infra/kube/kind/traefik-values.yml \
traefik traefik/traefik

kind load docker-image \
basegun-backend:$(make get-current-tag) \
basegun-frontend:$(make get-current-tag)

helm upgrade --install basegun ./infra/kube/helm/ \
--set ingress.hosts[0].host=basegun.k8s.local \
--set ingress.hosts[0].paths[0].path="/" \
--set ingress.hosts[0].paths[0].pathType="Prefix" \
--set backend.image.repository="basegun-backend" \
--set backend.image.tag="$(make get-current-tag)" \
--set frontend.image.repository="basegun-frontend" \
--set frontend.image.tag="$(make get-current-tag)" \
--set backend.secret.create="true" \
--set-string backend.secret.values.AWS_ACCESS_KEY_ID="x" \
--set-string backend.secret.values.AWS_SECRET_ACCESS_KEY="x" \
--set-string backend.secret.values.X_OVH_TOKEN="x" \
--set-string backend.secret.values.API_OVH_TOKEN="x"
Loading