-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·28 lines (20 loc) · 812 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# if any command returns non-zero, quit
set -e
export NAMESPACE=tcp-pool-proxy
echo "About to clean..."
go clean
echo "About to build..."
export GOOS=linux GOARCH=amd64
go build -i
echo "About to package as Docker container..."
eval $(minikube docker-env)
docker build . -t nextmetaphor/tcp-pool-proxy:latest
# happy to continue if the undeploy fails - it may not have been deployed yet...
set +e
echo "Deleting from k8s..."
kubectl delete -f _k8s/tcp-pool-proxy/service.yaml --namespace ${NAMESPACE} 2>/dev/null
kubectl delete -f _k8s/tcp-pool-proxy/deployment.yaml --namespace ${NAMESPACE} 2>/dev/null
echo "Creating in k8s..."
kubectl create -f _k8s/tcp-pool-proxy/deployment.yaml --namespace ${NAMESPACE}
kubectl create -f _k8s/tcp-pool-proxy/service.yaml --namespace ${NAMESPACE}