Skip to content

Commit

Permalink
fix terratest by adding image-repo between deploy-local-cluster args
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Nov 6, 2020
1 parent fa45037 commit f7b5c82
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ CLUSTER_GSLB1 = test-gslb1
CLUSTER_GSLB2 = test-gslb2

GSLB_DOMAIN ?= cloud.example.com
K8GB_IMAGE_REPO ?= absaoss/k8gb
REPO = absaoss/k8gb
VALUES_YAML ?= chart/k8gb/values.yaml
PODINFO_IMAGE_REPO ?= stefanprodan/podinfo
Expand Down Expand Up @@ -46,9 +45,9 @@ deploy-full-local-setup:
$(call create-local-cluster,$(CLUSTER_GSLB1),"deploy/kind/cluster.yaml")
$(call create-local-cluster,$(CLUSTER_GSLB2),"deploy/kind/cluster2.yaml")

$(call deploy-local-cluster,$(CLUSTER_GSLB1),$(CLUSTER_GSLB2),worker,)
$(call deploy-local-cluster,$(CLUSTER_GSLB1),$(CLUSTER_GSLB2),worker,absaoss/k8gb,)

$(call deploy-local-cluster,$(CLUSTER_GSLB2),$(CLUSTER_GSLB1),worker,$(HELM_ARGS))
$(call deploy-local-cluster,$(CLUSTER_GSLB2),$(CLUSTER_GSLB1),worker,absaoss/k8gb,$(HELM_ARGS))

# destroy local test environment
.PHONY: destroy-full-local-setup
Expand Down Expand Up @@ -86,17 +85,20 @@ terratest:
# triggered by terraform GitHub Action. Clusters already exists
.PHONY: deploy-full-terratest-setup
deploy-full-terratest-setup:
@echo "\n$(YELLOW)deploy registry $(NC)"
# TODO:move to Makefile
./deploy/registry.sh

@echo "\n$(YELLOW)build k8gb docker and push to registry $(NC)"
docker build . -t k8gb:`$(call git-last-commit-hash)`
docker tag k8gb:`$(call git-last-commit-hash)` localhost:5000/k8gb:v`$(call git-last-commit-hash)`
docker push localhost:5000/k8gb:v`$(call git-last-commit-hash)`
K8GB_IMAGE_REPO=localhost:5000/k8gb

@echo "\n$(YELLOW)Change version in Chart.yaml $(CYAN)`$(call version)` $(NC)"
@echo "\n$(YELLOW)Change version in Chart.yaml $(CYAN)`$(call version)` to `$(call git-last-commit-hash)`$(NC)"
sed -i "s/`$(call version)`/`$(call git-last-commit-hash)`/g" chart/k8gb/Chart.yaml

$(call deploy-local-cluster,$(CLUSTER_GSLB1),$(CLUSTER_GSLB2),control-plane,)
$(call deploy-local-cluster,$(CLUSTER_GSLB2),$(CLUSTER_GSLB1),control-plane,$(HELM_ARGS))
$(call deploy-local-cluster,$(CLUSTER_GSLB1),$(CLUSTER_GSLB2),control-plane,localhost:5000/k8gb,)
$(call deploy-local-cluster,$(CLUSTER_GSLB2),$(CLUSTER_GSLB1),control-plane,localhost:5000/k8gb,$(HELM_ARGS))

@echo "\n$(YELLOW)Local cluster $(CYAN)$(CLUSTER_GSLB2) $(NC)"
kubectl get pods -A
Expand Down Expand Up @@ -162,12 +164,12 @@ define deploy-local-cluster
@echo "\n$(YELLOW)Create namespace $(NC)"
kubectl apply -f deploy/namespace.yaml

@echo "\n$(YELLOW)Deploy GSLB operator $(NC)"
@echo "\n$(YELLOW)Deploy GSLB operator from $4 $(NC)"
cd chart/k8gb && helm dependency update
helm -n k8gb upgrade -i k8gb chart/k8gb -f $(VALUES_YAML) \
--set k8gb.hostAlias.enabled=true \
--set k8gb.hostAlias.ip="`$(call get-host-alias-ip,$1,$2,$3)`" \
--set k8gb.imageRepo=$(K8GB_IMAGE_REPO) $4
--set k8gb.imageRepo=$4 $5

@echo "\n$(YELLOW)Deploy Ingress $(NC)"
helm repo add --force-update stable https://charts.helm.sh/stable
Expand Down

0 comments on commit f7b5c82

Please sign in to comment.