homelab/services/parts-inventory/build-and-load.sh
Dan V deb6c38d7b chore: commit homelab setup — deployment, services, orchestration, skill
- Add .gitignore: exclude compiled binaries, build artifacts, and Helm
  values files containing real secrets (authentik, prometheus)
- Add all Kubernetes deployment manifests (deployment/)
- Add services source code: ha-sync, device-inventory, games-console,
  paperclip, parts-inventory
- Add Ansible orchestration: playbooks, roles, inventory, cloud-init
- Add hardware specs, execution plans, scripts, HOMELAB.md
- Add skills/homelab/SKILL.md + skills/install.sh to preserve Copilot skill
- Remove previously-tracked inventory-cli binary from git index

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-09 08:10:32 +02:00

30 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Build all parts-inventory images and load them onto the required k8s nodes.
# Run this from any machine with Docker and SSH access to the nodes.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NODE2_IP="192.168.2.195" # kube-node-2 (worker)
NODE3_IP="192.168.2.196" # kube-node-3 (control-plane + worker)
echo "=== Building parts-api:latest ==="
docker build -t parts-api:latest "$SCRIPT_DIR/api"
echo "=== Building parts-ui:latest ==="
docker build -t parts-ui:latest "$SCRIPT_DIR/ui"
echo "=== Building parts-cli:latest ==="
docker build -t parts-cli:latest "$SCRIPT_DIR/cli"
for node_ip in "$NODE2_IP" "$NODE3_IP"; do
echo "=== Loading images onto $node_ip ==="
for img in parts-api:latest parts-ui:latest parts-cli:latest; do
echo "$img"
docker save "$img" | ssh "dan@$node_ip" "sudo ctr --namespace k8s.io images import -"
done
done
echo ""
echo "=== All images loaded. Apply the manifest with: ==="
echo " kubectl apply -f /home/dan/homelab/deployment/infrastructure/parts-inventory.yaml"