mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
CI: route sandbox smoke through setup script
This commit is contained in:
24
.github/workflows/sandbox-common-smoke.yml
vendored
24
.github/workflows/sandbox-common-smoke.yml
vendored
@@ -51,19 +51,17 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
docker buildx build \
|
||||
--load \
|
||||
--tag openclaw-sandbox-common-smoke:bookworm-slim \
|
||||
--file Dockerfile.sandbox-common \
|
||||
--build-arg BASE_IMAGE=openclaw-sandbox-smoke-base:bookworm-slim \
|
||||
--build-arg PACKAGES=ca-certificates \
|
||||
--build-arg INSTALL_PNPM=0 \
|
||||
--build-arg INSTALL_BUN=0 \
|
||||
--build-arg INSTALL_BREW=0 \
|
||||
--build-arg FINAL_USER=sandbox \
|
||||
--cache-from type=gha,scope=sandbox-common-smoke \
|
||||
--cache-to type=gha,mode=max,scope=sandbox-common-smoke \
|
||||
.
|
||||
BASE_IMAGE="openclaw-sandbox-smoke-base:bookworm-slim" \
|
||||
TARGET_IMAGE="openclaw-sandbox-common-smoke:bookworm-slim" \
|
||||
PACKAGES="ca-certificates" \
|
||||
INSTALL_PNPM=0 \
|
||||
INSTALL_BUN=0 \
|
||||
INSTALL_BREW=0 \
|
||||
FINAL_USER=sandbox \
|
||||
OPENCLAW_DOCKER_BUILD_USE_BUILDX=1 \
|
||||
OPENCLAW_DOCKER_BUILD_CACHE_FROM="type=gha,scope=sandbox-common-smoke" \
|
||||
OPENCLAW_DOCKER_BUILD_CACHE_TO="type=gha,mode=max,scope=sandbox-common-smoke" \
|
||||
scripts/sandbox-common-setup.sh
|
||||
|
||||
u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
|
||||
test "$u" = "sandbox"
|
||||
|
||||
@@ -10,6 +10,9 @@ BUN_INSTALL_DIR="${BUN_INSTALL_DIR:-/opt/bun}"
|
||||
INSTALL_BREW="${INSTALL_BREW:-1}"
|
||||
BREW_INSTALL_DIR="${BREW_INSTALL_DIR:-/home/linuxbrew/.linuxbrew}"
|
||||
FINAL_USER="${FINAL_USER:-sandbox}"
|
||||
OPENCLAW_DOCKER_BUILD_USE_BUILDX="${OPENCLAW_DOCKER_BUILD_USE_BUILDX:-0}"
|
||||
OPENCLAW_DOCKER_BUILD_CACHE_FROM="${OPENCLAW_DOCKER_BUILD_CACHE_FROM:-}"
|
||||
OPENCLAW_DOCKER_BUILD_CACHE_TO="${OPENCLAW_DOCKER_BUILD_CACHE_TO:-}"
|
||||
|
||||
if ! docker image inspect "${BASE_IMAGE}" >/dev/null 2>&1; then
|
||||
echo "Base image missing: ${BASE_IMAGE}"
|
||||
@@ -19,7 +22,18 @@ fi
|
||||
|
||||
echo "Building ${TARGET_IMAGE} with: ${PACKAGES}"
|
||||
|
||||
docker build \
|
||||
build_cmd=(docker build)
|
||||
if [ "${OPENCLAW_DOCKER_BUILD_USE_BUILDX}" = "1" ]; then
|
||||
build_cmd=(docker buildx build --load)
|
||||
if [ -n "${OPENCLAW_DOCKER_BUILD_CACHE_FROM}" ]; then
|
||||
build_cmd+=(--cache-from "${OPENCLAW_DOCKER_BUILD_CACHE_FROM}")
|
||||
fi
|
||||
if [ -n "${OPENCLAW_DOCKER_BUILD_CACHE_TO}" ]; then
|
||||
build_cmd+=(--cache-to "${OPENCLAW_DOCKER_BUILD_CACHE_TO}")
|
||||
fi
|
||||
fi
|
||||
|
||||
"${build_cmd[@]}" \
|
||||
-t "${TARGET_IMAGE}" \
|
||||
-f Dockerfile.sandbox-common \
|
||||
--build-arg BASE_IMAGE="${BASE_IMAGE}" \
|
||||
|
||||
Reference in New Issue
Block a user