-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·30 lines (24 loc) · 976 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
29
30
#!/bin/bash
SCRIPT_PATH="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
source "$SCRIPT_PATH/.github/workflows/kind/env.sh"
echo 'Building the container image...'
DOCKER_BUILDKIT=1 docker build -t localhost:5001/kubernetes-hello .
echo 'Pushing the container image...'
docker push localhost:5001/kubernetes-hello
echo 'Listing the remote container image tags...'
#wget -qO- http://localhost:5001/v2/_catalog | jq
wget -qO- http://localhost:5001/v2/kubernetes-hello/tags/list | jq
# delete the existing pod.
kubectl get pods -l app=kubernetes-hello -o name | while read pod_name; do
echo "Deleting existing pod $pod_name..."
kubectl delete "$pod_name"
done
echo 'Deploying the application...'
sed -E 's,(\simage:).+,\1 localhost:5001/kubernetes-hello:latest,g' \
resources.yml \
| kubectl apply \
-f -
echo 'Waiting for the application to be running...'
kubectl rollout status \
--timeout 3m \
daemonset/kubernetes-hello