From e0849cdb62ae9ed52d485049388cf16e1ca747f1 Mon Sep 17 00:00:00 2001 From: Philip Peterson Date: Tue, 26 May 2026 00:00:59 -0800 Subject: [PATCH] bump --- bump-hyper.sh | 32 ++++++++++++++++++++++++++++++++ nixos/linux.nix | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 bump-hyper.sh diff --git a/bump-hyper.sh b/bump-hyper.sh new file mode 100755 index 0000000..de5886c --- /dev/null +++ b/bump-hyper.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +LINUX=/root/petersweb-infra/nixos/linux.nix + +usage() { + echo "Usage: $0 " + echo " e.g. $0 sha256:2e2d92abae0ba68be780fff581523480ac05444690dbf38bf4330f1dda099e2a" + exit 1 +} + +[[ $# -eq 1 ]] || usage + +NEW_DIGEST="${1#sha256:}" # strip leading "sha256:" if provided + +# Validate: hex string of the right length +if ! [[ "$NEW_DIGEST" =~ ^[0-9a-f]{64}$ ]]; then + echo "Error: digest must be a 64-character lowercase hex string (got: $NEW_DIGEST)" >&2 + exit 1 +fi + +OLD_LINE=$(grep -n 'hyper-quineglobal-com@sha256:' "$LINUX") +echo "Current: $OLD_LINE" + +sed -i -E "s|(hyper-quineglobal-com@sha256:)[0-9a-f]{64}|\1${NEW_DIGEST}|" "$LINUX" + +NEW_LINE=$(grep -n 'hyper-quineglobal-com@sha256:' "$LINUX") +echo "Updated: $NEW_LINE" + +echo "Applying NixOS configuration..." +nixos-rebuild switch --flake /root/petersweb-infra/nixos#mainframe +echo "Done. Tail logs with: docker logs -f hyper-quineglobal-com" diff --git a/nixos/linux.nix b/nixos/linux.nix index a1dcafc..89659c7 100644 --- a/nixos/linux.nix +++ b/nixos/linux.nix @@ -298,7 +298,7 @@ in { "hyper-quineglobal-com" = { autoStart = true; - image = "forge.quinefoundation.com/ironmagma/hyper-quineglobal-com@sha256:bc7c4bc95c87e72df0bef0de888289d370ec707a27783b6b99befe63acacf7a1"; + image = "forge.quinefoundation.com/ironmagma/hyper-quineglobal-com@sha256:2e2d92abae0ba68be780fff581523480ac05444690dbf38bf4330f1dda099e2a"; volumes = []; environment = {}; ports = ["3013:8081"];