fix: make imgproxy artifact checksums portable

This commit is contained in:
john
2026-07-15 11:48:09 +08:00
parent dd0014db83
commit 72f1266078
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -17,9 +17,9 @@ fi
command -v docker >/dev/null || { echo 'docker is required to build the imgproxy runtime image' >&2; exit 1; }
if ! docker image inspect "$IMAGE_REF" >/dev/null 2>&1; then
docker pull --platform linux/arm64 "$IMAGE_REF"
docker pull --platform linux/arm64 "$IMAGE_REF"
fi
docker tag "$IMAGE_REF" "$IMAGE_TAG"
docker save "$IMAGE_TAG" | gzip -c > "$OUT_DIR/imgproxy-runtime-image.tar.gz"
shasum -a 256 "$OUT_DIR/imgproxy-runtime-image.tar.gz" > "$OUT_DIR/imgproxy-runtime-image.tar.gz.sha256"
(cd "$OUT_DIR" && shasum -a 256 imgproxy-runtime-image.tar.gz > imgproxy-runtime-image.tar.gz.sha256)
printf '%s\n' "$IMAGE_TAG" > "$OUT_DIR/image-tag.txt"
@@ -14,6 +14,7 @@ test('imgproxy runtime pins an arm64 image digest', () => {
test('builder reuses an already verified digest without a network pull', () => {
const builder = read('scripts/build-imgproxy-runtime-image.sh');
assert.match(builder, /docker image inspect "\$IMAGE_REF"/);
assert.match(builder, /shasum -a 256 imgproxy-runtime-image\.tar\.gz/);
});
test('installer uses a read-only storage mount and both required ports', () => {
@@ -27,6 +28,7 @@ test('installer uses a read-only storage mount and both required ports', () => {
test('release verifies checksums before loading the image and backs up launch state', () => {
const release = read('scripts/release-imgproxy-runtime-prod.sh');
assert.match(release, /shasum -a 256 -c/);
assert.match(release, /shasum -a 256 "imgproxy-runtime-\$RELEASE_ID\.tar\.gz"/);
assert.match(release, /docker load/);
assert.match(release, /imgproxy-compat-\$RELEASE_ID\.plist/);
assert.match(release, /img\.tkmind\.cn\/health/);
+1 -1
View File
@@ -31,7 +31,7 @@ cp "$IMAGE_DIR"/* "$TMP/runtime/"
cp "$ROOT/scripts/install-imgproxy-runtime-prod.sh" "$ROOT/scripts/imgproxy-compat-proxy.mjs" "$TMP/runtime/"
chmod 755 "$TMP/runtime/install-imgproxy-runtime-prod.sh"
tar -C "$TMP" -czf "$TMP/imgproxy-runtime-$RELEASE_ID.tar.gz" runtime
shasum -a 256 "$TMP/imgproxy-runtime-$RELEASE_ID.tar.gz" > "$TMP/imgproxy-runtime-$RELEASE_ID.tar.gz.sha256"
(cd "$TMP" && shasum -a 256 "imgproxy-runtime-$RELEASE_ID.tar.gz" > "imgproxy-runtime-$RELEASE_ID.tar.gz.sha256")
ssh -o BatchMode=yes "$HOST" "mkdir -p '$INCOMING'"
scp -q "$TMP/imgproxy-runtime-$RELEASE_ID.tar.gz" "$TMP/imgproxy-runtime-$RELEASE_ID.tar.gz.sha256" "$HOST:$INCOMING/"