-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd3ec3c
commit f6c8dbb
Showing
1 changed file
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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) basegun-frontend:$(make get-current-tag) | ||
helm upgrade --install basegun ./infra/kube/helm/ \ | ||
--set ingress.hosts[0].host="$LOCAL_DOMAIN" \ | ||
--set ingress.hosts[0].paths[0].path="/" \ | ||
|
@@ -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 | ||
|
||
|