-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy-pi
executable file
·25 lines (22 loc) · 1.09 KB
/
deploy-pi
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
#! /bin/bash
set -uexo pipefail
deploy() {
docker buildx build -f Dockerfile.controller --platform linux/arm64/v8 -t ghcr.io/maelvls/print-your-cert-controller:latest -o type=docker .
docker rm -f print-your-cert-controller
docker run -d --restart=always --name print-your-cert-controller --privileged -v /dev/bus/usb:/dev/bus/usb -v $HOME/.kube/config:/root/.kube/config --net=host ghcr.io/maelvls/print-your-cert-controller:latest
GOARCH=arm64 CGO_ENABLED=0 go build -o print-your-cert-ui-arm64 .
docker buildx build -f Dockerfile.ui --platform linux/arm64/v8 -t ghcr.io/maelvls/print-your-cert-ui:latest -o type=docker .
docker rm -f print-your-cert-ui
docker run -d --restart=always --name print-your-cert-ui --net=host -v $HOME/.kube/config:/root/.kube/config ghcr.io/maelvls/print-your-cert-ui:latest --issuer ca-issuer --issuer-kind ClusterIssuer --listen 0.0.0.0:8080
}
deploy
while true; do
sleep 10s
git remote update
if git merge-base --is-ancestor origin/main main; then
echo No new commit, skipping
continue
fi
git pull
deploy
done