-
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 5689e26
Showing
3 changed files
with
32 additions
and
12 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 |
---|---|---|
|
@@ -12,11 +12,34 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
LOCAL_DOMAIN: basegun.kubernetes.local | ||
KIND_CLUSTER_NAME: basegun-testing | ||
steps: | ||
- name: Start minikube | ||
uses: medyagh/setup-minikube@latest | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
addons: registry,ingress | ||
cluster_name: $KIND_CLUSTER_NAME | ||
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 +48,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 +57,12 @@ 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 \ | ||
--name $KIND_CLUSTER_NAME | ||
helm upgrade --install basegun ./infra/kube/helm/ \ | ||
--set ingress.hosts[0].host="$LOCAL_DOMAIN" \ | ||
--set ingress.hosts[0].paths[0].path="/" \ | ||
|
@@ -81,7 +103,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 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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