fix: use explicit docker path in imgproxy release
This commit is contained in:
@@ -23,13 +23,15 @@ test('installer uses a read-only storage mount and both required ports', () => {
|
|||||||
assert.match(installer, /\$MINDSPACE_STORAGE_ROOT:\/mnt\/images:ro/);
|
assert.match(installer, /\$MINDSPACE_STORAGE_ROOT:\/mnt\/images:ro/);
|
||||||
assert.match(installer, /10\.10\.0\.2/);
|
assert.match(installer, /10\.10\.0\.2/);
|
||||||
assert.match(installer, /IMGPROXY_UPSTREAM/);
|
assert.match(installer, /IMGPROXY_UPSTREAM/);
|
||||||
|
assert.match(installer, /DOCKER_BIN/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('release verifies checksums before loading the image and backs up launch state', () => {
|
test('release verifies checksums before loading the image and backs up launch state', () => {
|
||||||
const release = read('scripts/release-imgproxy-runtime-prod.sh');
|
const release = read('scripts/release-imgproxy-runtime-prod.sh');
|
||||||
assert.match(release, /shasum -a 256 -c/);
|
assert.match(release, /shasum -a 256 -c/);
|
||||||
assert.match(release, /shasum -a 256 "imgproxy-runtime-\$RELEASE_ID\.tar\.gz"/);
|
assert.match(release, /shasum -a 256 "imgproxy-runtime-\$RELEASE_ID\.tar\.gz"/);
|
||||||
assert.match(release, /docker load/);
|
assert.match(release, /"\$DOCKER_BIN" load/);
|
||||||
|
assert.match(release, /DOCKER_BIN/);
|
||||||
assert.match(release, /imgproxy-compat-\$RELEASE_ID\.plist/);
|
assert.match(release, /imgproxy-compat-\$RELEASE_ID\.plist/);
|
||||||
assert.match(release, /img\.tkmind\.cn\/health/);
|
assert.match(release, /img\.tkmind\.cn\/health/);
|
||||||
assert.match(release, /release\/\*/);
|
assert.match(release, /release\/\*/);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ RUNTIME_DIR="${IMGPROXY_RUNTIME_DIR:?IMGPROXY_RUNTIME_DIR is required}"
|
|||||||
IMAGE_TAG="${IMGPROXY_IMAGE_TAG:?IMGPROXY_IMAGE_TAG is required}"
|
IMAGE_TAG="${IMGPROXY_IMAGE_TAG:?IMGPROXY_IMAGE_TAG is required}"
|
||||||
CONTAINER="${IMGPROXY_CONTAINER:-memind-imgproxy}"
|
CONTAINER="${IMGPROXY_CONTAINER:-memind-imgproxy}"
|
||||||
NODE_BIN="${NODE_BIN:-/opt/homebrew/opt/node@24/bin/node}"
|
NODE_BIN="${NODE_BIN:-/opt/homebrew/opt/node@24/bin/node}"
|
||||||
|
DOCKER_BIN="${DOCKER_BIN:-/opt/homebrew/bin/docker}"
|
||||||
PLIST="$HOME/Library/LaunchAgents/cn.tkmind.imgproxy-compat.plist"
|
PLIST="$HOME/Library/LaunchAgents/cn.tkmind.imgproxy-compat.plist"
|
||||||
GUI="gui/$(id -u)"
|
GUI="gui/$(id -u)"
|
||||||
|
|
||||||
@@ -17,8 +18,8 @@ set +a
|
|||||||
: "${IMGPROXY_SIGNING_SALT:?missing IMGPROXY_SIGNING_SALT}"
|
: "${IMGPROXY_SIGNING_SALT:?missing IMGPROXY_SIGNING_SALT}"
|
||||||
: "${MINDSPACE_STORAGE_ROOT:?missing MINDSPACE_STORAGE_ROOT}"
|
: "${MINDSPACE_STORAGE_ROOT:?missing MINDSPACE_STORAGE_ROOT}"
|
||||||
|
|
||||||
docker rm -f "$CONTAINER" >/dev/null 2>&1 || true
|
"$DOCKER_BIN" rm -f "$CONTAINER" >/dev/null 2>&1 || true
|
||||||
docker run -d --name "$CONTAINER" --restart unless-stopped \
|
"$DOCKER_BIN" run -d --name "$CONTAINER" --restart unless-stopped \
|
||||||
-p 127.0.0.1:20082:8080 \
|
-p 127.0.0.1:20082:8080 \
|
||||||
-v "$MINDSPACE_STORAGE_ROOT:/mnt/images:ro" \
|
-v "$MINDSPACE_STORAGE_ROOT:/mnt/images:ro" \
|
||||||
-e IMGPROXY_LOCAL_FILESYSTEM_ROOT=/mnt/images \
|
-e IMGPROXY_LOCAL_FILESYSTEM_ROOT=/mnt/images \
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ set -euo pipefail
|
|||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
HOST="${STUDIO_HOST:-john@58.38.22.103}"
|
HOST="${STUDIO_HOST:-john@58.38.22.103}"
|
||||||
REMOTE_ROOT="${STUDIO_REMOTE_ROOT:-/Users/john/Project}"
|
REMOTE_ROOT="${STUDIO_REMOTE_ROOT:-/Users/john/Project}"
|
||||||
|
DOCKER_BIN="${DOCKER_BIN:-/opt/homebrew/bin/docker}"
|
||||||
RUNTIME_BASE="$REMOTE_ROOT/imgproxy-runtime"
|
RUNTIME_BASE="$REMOTE_ROOT/imgproxy-runtime"
|
||||||
INCOMING="$REMOTE_ROOT/incoming/imgproxy-runtime"
|
INCOMING="$REMOTE_ROOT/incoming/imgproxy-runtime"
|
||||||
RELEASE_ID="$(date +%Y%m%d-%H%M%S)-$(git -C "$ROOT" rev-parse --short HEAD)"
|
RELEASE_ID="$(date +%Y%m%d-%H%M%S)-$(git -C "$ROOT" rev-parse --short HEAD)"
|
||||||
@@ -47,7 +48,7 @@ cp "$HOME/Library/LaunchAgents/cn.tkmind.imgproxy-compat.plist" "$RUNTIME_BASE/b
|
|||||||
tar -xzf "$archive" -C "$release_dir" --strip-components=1
|
tar -xzf "$archive" -C "$release_dir" --strip-components=1
|
||||||
cd "$release_dir"
|
cd "$release_dir"
|
||||||
shasum -a 256 -c imgproxy-runtime-image.tar.gz.sha256
|
shasum -a 256 -c imgproxy-runtime-image.tar.gz.sha256
|
||||||
gunzip -c imgproxy-runtime-image.tar.gz | docker load
|
gunzip -c imgproxy-runtime-image.tar.gz | "$DOCKER_BIN" load
|
||||||
image_tag="$(cat image-tag.txt)"
|
image_tag="$(cat image-tag.txt)"
|
||||||
IMGPROXY_RUNTIME_DIR="$release_dir" IMGPROXY_IMAGE_TAG="$image_tag" bash ./install-imgproxy-runtime-prod.sh
|
IMGPROXY_RUNTIME_DIR="$release_dir" IMGPROXY_IMAGE_TAG="$image_tag" bash ./install-imgproxy-runtime-prod.sh
|
||||||
ln -sfn "$release_dir" "$RUNTIME_BASE/current"
|
ln -sfn "$release_dir" "$RUNTIME_BASE/current"
|
||||||
|
|||||||
Reference in New Issue
Block a user