-
Notifications
You must be signed in to change notification settings - Fork 101
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
Showing
2 changed files
with
58 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# https://taskfile.dev/usage/ | ||
version: '3' | ||
env: | ||
VERSION: test004 | ||
|
||
tasks: | ||
|
||
start-*: | ||
vars: | ||
CLUSTER: '{{index .MATCH 0}}' | ||
cmds: | ||
- echo "starting $CLUSTER" | ||
- kubectl -n k8gb scale deployment k8gb --replicas=1 --context=$CLUSTER | ||
description: "k3d-test-gslb2 = us, k3d-test-gslb1 = eu" | ||
|
||
stop-*: | ||
vars: | ||
CLUSTER: '{{index .MATCH 0}}' | ||
cmds: | ||
- echo "stopping $CLUSTER" | ||
- kubectl -n k8gb scale deployment k8gb --replicas=0 --context=$CLUSTER | ||
description: "k3d-test-gslb2 = us, k3d-test-gslb1 = eu" | ||
|
||
install: | ||
cmds: | ||
- defer: { task: us} | ||
- echo "Installing current k8gb $VERSION" | ||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w -X main.version=$VERSION -X main.commit=123" -o ./k8gb main.go | ||
- docker build . -t docker.io/kuritka/k8gb:$VERSION | ||
- k3d image import docker.io/kuritka/k8gb:$VERSION -c test-gslb1 | ||
- k3d image import docker.io/kuritka/k8gb:$VERSION -c test-gslb2 | ||
- kubectl apply -f deploy/crds/test-ingress-init.yaml --context=k3d-test-gslb2 # for INGRESS_PATH=test-gslb/init-ingress | ||
- kubectl apply -f deploy/crds/test-ingress-init.yaml --context=k3d-test-gslb1 # for INGRESS_PATH=test-gslb/init-ingress | ||
- task: stop | ||
- kubectl -n k8gb set image deployment/k8gb k8gb=kuritka/k8gb:$VERSION --context=k3d-test-gslb2 | ||
- kubectl -n k8gb set image deployment/k8gb k8gb=kuritka/k8gb:$VERSION --context=k3d-test-gslb1 | ||
- task: start_k3d-test-gslb1 | ||
silent: true | ||
|
||
stop: | ||
cmds: | ||
- task: stop_k3d-test-gslb1 | ||
- task: stop_k3d-test-gslb2 | ||
|
||
start: | ||
cmds: | ||
- task: start_k3d-test-gslb1 | ||
- task: start_k3d-test-gslb2 | ||
|
||
us: | ||
cmds: | ||
- kubectl config use-context k3d-test-gslb2 | ||
eu: | ||
cmds: | ||
- kubectl config use-context k3d-test-gslb1 |
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