Skip to content

Commit

Permalink
ci: 👷 use kind instead of minikube
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-tobi committed Jul 21, 2023
1 parent bd3ec3c commit 2669d3b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/test-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,32 @@ jobs:
env:
LOCAL_DOMAIN: basegun.kubernetes.local
steps:
- name: Start minikube
uses: medyagh/setup-minikube@latest
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
addons: registry,ingress
cluster_name: basegun-testing
wait: 60s
verbosity: 2

- name: Set up ingress controller
run: |
cat << EOF > values.yml
deployment:
kind: DaemonSet
ingressClass:
enabled: true
isDefaultClass: true
ports:
web:
hostPort: 80
websecure:
hostPort: 443
service:
type: ClusterIP
EOF
helm repo add traefik https://traefik.github.io/charts && helm repo update
helm install --namespace ingress-traefik --create-namespace traefik traefik/traefik -f values.yml
kubectl --namespace ingress-traefik rollout status daemonset traefik --timeout=90s
- name: Set up Helm
uses: azure/setup-helm@v3
Expand All @@ -25,8 +47,7 @@ jobs:

- name: Add hosts to /etc/hosts
run: |
MINIKUBE_IP="$(minikube ip)"
sudo echo "$MINIKUBE_IP $LOCAL_DOMAIN" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 $LOCAL_DOMAIN" | sudo tee -a /etc/hosts
# we are forced to attribute a DNS to kube cluster for it to work properly

- name: Checkout to code
Expand All @@ -35,12 +56,9 @@ jobs:
- name: Build and install basegun with helm, and test if deployment is successful
id: tests
run: |
# use docker env
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build backend
TAG=$(make get-current-tag) docker-compose -f docker-compose-prod.yml build frontend
kind load docker-image basegun-backend:$(make get-current-tag)-prod basegun-frontend:$(make get-current-tag)-prod
helm upgrade --install basegun ./infra/kube/helm/ \
--set ingress.hosts[0].host="$LOCAL_DOMAIN" \
--set ingress.hosts[0].paths[0].path="/" \
Expand Down Expand Up @@ -81,7 +99,7 @@ jobs:
run: npm ci
working-directory: ./frontend

- name: Test end to end
- name: Test end to end (cypress)
run: FRONTEND_HOST=$LOCAL_DOMAIN FRONTEND_PORT=80 npm run test:e2e-ci
working-directory: ./frontend

Expand Down
1 change: 0 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@vue/compat": "^3.3.2",
"@vueuse/core": "^10.1.2",
"axios": "^1.4.0",
"cypress": "^12.13.0",
"pinia": "^2.1.0",
"stylelint-config-recommended-vue": "^1.4.0",
"swiper": "^9.3.2",
Expand Down

0 comments on commit 2669d3b

Please sign in to comment.