-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·29 lines (22 loc) · 762 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·29 lines (22 loc) · 762 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
REPO="us-east1-docker.pkg.dev/homelab-464022/homelab-repo"
TAG=$(git rev-parse --short HEAD)
build_and_push() {
local name=$1
local dockerfile=$2
local image="${REPO}/${name}:${TAG}"
echo "Building ${image}..."
docker build --platform linux/amd64 -t "${image}" -f "${dockerfile}" .
if gcloud artifacts docker images describe "${image}" &>/dev/null; then
echo "Image ${image} already exists in Artifact Registry, skipping push."
else
echo "Pushing ${image}..."
docker push "${image}"
fi
echo " ${image}"
}
build_and_push "durable-execution" "Dockerfile"
build_and_push "durable-execution-migrations" "Dockerfile.migrations"
echo ""
echo "Image tag: ${TAG}"