26 lines
735 B
Bash
Executable File
26 lines
735 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# build-push.sh — build and push humor-units image to the in-cluster registry
|
|
# Usage: ./build-push.sh [tag]
|
|
# Requires: buildah, kubectl
|
|
set -euo pipefail
|
|
|
|
TAG="${1:-latest}"
|
|
# Use a node IP:NodePort — resolvable from both dev machine and cluster nodes
|
|
REGISTRY="${REGISTRY:-<NODE_IP>:30500}"
|
|
IMAGE="$REGISTRY/humor-units:$TAG"
|
|
|
|
echo "==> Building $IMAGE..."
|
|
buildah build \
|
|
--format docker \
|
|
--tag "$IMAGE" \
|
|
"$(dirname "$0")"
|
|
|
|
echo "==> Pushing $IMAGE..."
|
|
buildah push --tls-verify=false "$IMAGE"
|
|
|
|
echo "==> Restarting humor-units deployment..."
|
|
kubectl rollout restart deployment/humor-units -n default
|
|
|
|
echo "==> Done. Waiting for rollout..."
|
|
kubectl rollout status deployment/humor-units -n default
|