fix(hwlab): install tools yaml dependency with bun proxy (#816)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-24 11:16:56 +08:00
committed by GitHub
parent d9197898d2
commit 1ac20735a1
+1 -1
View File
@@ -140,7 +140,7 @@ targets:
- ARG no_proxy
- RUN ln -sf /usr/local/bin/bun /usr/local/bin/bunx
- ENV HWLAB_CI_NODE_DEPS=/opt/hwlab-ci-node-deps/node_modules
- RUN set -eu; deps=/opt/hwlab-ci-node-deps/node_modules; mkdir -p "$deps/yaml"; proxy="${HTTPS_PROXY:-${HTTP_PROXY:-}}"; curl_args="-fsSL --connect-timeout 10 --max-time 120 --retry 2"; if [ -n "$proxy" ]; then curl_args="$curl_args --proxy $proxy"; fi; curl $curl_args https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz | tar -xz -C "$deps/yaml" --strip-components=1; test -f "$deps/yaml/package.json"; node -e 'const path=require("path"); const yaml=require("/opt/hwlab-ci-node-deps/node_modules/yaml"); console.log("yaml-ok", typeof yaml.parse, path.basename(require.resolve("/opt/hwlab-ci-node-deps/node_modules/yaml")));'
- RUN set -eu; export HTTP_PROXY="${HTTP_PROXY:-${http_proxy:-}}"; export HTTPS_PROXY="${HTTPS_PROXY:-${https_proxy:-$HTTP_PROXY}}"; export ALL_PROXY="${ALL_PROXY:-${all_proxy:-}}"; export NO_PROXY="${NO_PROXY:-${no_proxy:-}}"; export http_proxy="$HTTP_PROXY"; export https_proxy="$HTTPS_PROXY"; export all_proxy="$ALL_PROXY"; export no_proxy="$NO_PROXY"; mkdir -p /opt/hwlab-ci-node-deps; cd /opt/hwlab-ci-node-deps; printf '{"private":true,"dependencies":{}}\n' > package.json; printf '[install]\nregistry = "https://registry.npmjs.org/"\n' > bunfig.toml; bun add --no-save --ignore-scripts yaml@2.8.3; node --input-type=module -e 'import("/opt/hwlab-ci-node-deps/node_modules/yaml/browser/dist/index.js").then((yaml)=>console.log("yaml-ok", typeof yaml.parse))'
- RUN node --version && npm --version && bun --version && git --version && python3 --version && docker --version && ssh -V
buildArgs: {}
buildNetwork: host