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
|
#!/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]
|
# Usage: ./build-push.sh [tag]
|
||||||
# Requires: buildah, ssh access to nodes, crictl on nodes
|
# Requires: docker, access to registry.nerdrage.cloud
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
TAG="${1:-latest}"
|
TAG="${1:-latest}"
|
||||||
IMAGE="localhost/humor-units:$TAG"
|
REGISTRY="registry.nerdrage.cloud"
|
||||||
ARCHIVE="/tmp/humor-units.tar"
|
IMAGE="$REGISTRY/dickloads:$TAG"
|
||||||
# Space-separated list of node SSH targets
|
|
||||||
NODES="${NODES:-node1 node2}"
|
|
||||||
|
|
||||||
echo "==> Building $IMAGE..."
|
echo "==> Building $IMAGE..."
|
||||||
buildah build \
|
docker build --tag "$IMAGE" "$(dirname "$0")"
|
||||||
--format docker \
|
|
||||||
--tag "$IMAGE" \
|
|
||||||
"$(dirname "$0")"
|
|
||||||
|
|
||||||
echo "==> Exporting to OCI archive $ARCHIVE..."
|
echo "==> Pushing $IMAGE..."
|
||||||
buildah push "$IMAGE" "oci-archive:${ARCHIVE}:${IMAGE}"
|
docker push "$IMAGE"
|
||||||
|
|
||||||
for NODE in $NODES; do
|
echo "==> Restarting deployment..."
|
||||||
echo "==> Copying to $NODE..."
|
kubectl rollout restart deployment/humor-units -n dickloads
|
||||||
scp "$ARCHIVE" "$NODE:/tmp/humor-units.tar"
|
|
||||||
|
|
||||||
echo "==> Importing on $NODE via crictl..."
|
echo "==> Waiting for rollout..."
|
||||||
ssh "$NODE" "crictl image import /tmp/humor-units.tar && rm /tmp/humor-units.tar"
|
kubectl rollout status deployment/humor-units -n dickloads
|
||||||
|
|
||||||
echo "==> Verifying on $NODE..."
|
echo "==> Done."
|
||||||
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
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: humor-units
|
- name: humor-units
|
||||||
image: localhost/humor-units:latest
|
image: registry.nerdrage.cloud/dickloads:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user