chore: clean up build scripts — simple docker build+push to registry.nerdrage.cloud
- Remove build-local.sh and old build-push.sh (crictl/scp/buildah workflow) - New build-push.sh: docker build + push to registry.nerdrage.cloud/dickloads - deployment.yaml: update image to registry.nerdrage.cloud/dickloads:latest, imagePullPolicy Always
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# build-local.sh — import humor-units image on the local node via crictl
|
||||
# Run this directly on each cluster node after copying humor-units.tar to /tmp/
|
||||
# Usage: sudo ./build-local.sh
|
||||
set -euo pipefail
|
||||
|
||||
ARCHIVE="${1:-/tmp/humor-units.tar}"
|
||||
|
||||
if [[ ! -f "$ARCHIVE" ]]; then
|
||||
echo "Error: $ARCHIVE not found. Copy the tar first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Importing $ARCHIVE via crictl..."
|
||||
crictl image import "$ARCHIVE"
|
||||
|
||||
echo "==> Verifying..."
|
||||
crictl images | grep humor
|
||||
|
||||
echo "==> Done."
|
||||
@@ -1,37 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# build-push.sh — build humor-units image and import it into containerd on each node
|
||||
# build-push.sh — build and push humor-units image to the private registry
|
||||
# Usage: ./build-push.sh [tag]
|
||||
# Requires: buildah, ssh access to nodes, crictl on nodes
|
||||
# Requires: docker, access to registry.nerdrage.cloud
|
||||
set -euo pipefail
|
||||
|
||||
TAG="${1:-latest}"
|
||||
IMAGE="localhost/humor-units:$TAG"
|
||||
ARCHIVE="/tmp/humor-units.tar"
|
||||
# Space-separated list of node SSH targets
|
||||
NODES="${NODES:-node1 node2}"
|
||||
REGISTRY="registry.nerdrage.cloud"
|
||||
IMAGE="$REGISTRY/dickloads:$TAG"
|
||||
|
||||
echo "==> Building $IMAGE..."
|
||||
buildah build \
|
||||
--format docker \
|
||||
--tag "$IMAGE" \
|
||||
"$(dirname "$0")"
|
||||
docker build --tag "$IMAGE" "$(dirname "$0")"
|
||||
|
||||
echo "==> Exporting to OCI archive $ARCHIVE..."
|
||||
buildah push "$IMAGE" "oci-archive:${ARCHIVE}:${IMAGE}"
|
||||
echo "==> Pushing $IMAGE..."
|
||||
docker push "$IMAGE"
|
||||
|
||||
for NODE in $NODES; do
|
||||
echo "==> Copying to $NODE..."
|
||||
scp "$ARCHIVE" "$NODE:/tmp/humor-units.tar"
|
||||
echo "==> Restarting deployment..."
|
||||
kubectl rollout restart deployment/humor-units -n dickloads
|
||||
|
||||
echo "==> Importing on $NODE via crictl..."
|
||||
ssh "$NODE" "crictl image import /tmp/humor-units.tar && rm /tmp/humor-units.tar"
|
||||
echo "==> Waiting for rollout..."
|
||||
kubectl rollout status deployment/humor-units -n dickloads
|
||||
|
||||
echo "==> Verifying on $NODE..."
|
||||
ssh "$NODE" "crictl images | grep humor"
|
||||
done
|
||||
|
||||
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
|
||||
echo "==> Done."
|
||||
|
||||
@@ -16,8 +16,8 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: humor-units
|
||||
image: localhost/humor-units:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
image: registry.nerdrage.cloud/dickloads:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user