ci: use pnpm lockfile and proxy BuildKit pulls

This commit is contained in:
2026-08-11 23:06:07 +08:00
parent 95932f0199
commit 888925c755
2 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -4,8 +4,8 @@ ARG DOTNET_RUNTIME_IMAGE=mcr.microsoft.com/dotnet/aspnet:6.0
FROM ${NODE_IMAGE} AS frontend-build FROM ${NODE_IMAGE} AS frontend-build
WORKDIR /src/app WORKDIR /src/app
COPY app/package.json app/package-lock.json ./ COPY app/package.json app/pnpm-lock.yaml ./
RUN npm ci RUN npx --yes pnpm@10.15.0 install --frozen-lockfile
COPY app/ ./ COPY app/ ./
RUN npm run build RUN npm run build
Vendored
+7 -3
View File
@@ -26,7 +26,7 @@ pipeline {
OPENLIST_BASE_URL = 'https://openlist.nxsir.cn' OPENLIST_BASE_URL = 'https://openlist.nxsir.cn'
OPENLIST_REMOTE_DIR = '/yidongpan/构建产物/douyin' OPENLIST_REMOTE_DIR = '/yidongpan/构建产物/douyin'
HTTP_PROXY_URL = 'http://192.168.5.200:7890' HTTP_PROXY_URL = 'http://192.168.5.200:7890'
NO_PROXY_HOSTS = '127.0.0.1,localhost,reg.nxsir.cn,gitea.nxsir.cn,openlist.nxsir.cn,mcr.microsoft.com,docker.m.daocloud.io' NO_PROXY_HOSTS = '127.0.0.1,localhost,reg.nxsir.cn,gitea.nxsir.cn,openlist.nxsir.cn,mcr.microsoft.com'
BUILDER_NAME = "douyin-${BUILD_NUMBER}" BUILDER_NAME = "douyin-${BUILD_NUMBER}"
DOCKER_CONFIG = "${WORKSPACE}/.ci/docker" DOCKER_CONFIG = "${WORKSPACE}/.ci/docker"
NPM_CONFIG_CACHE = "${WORKSPACE}/.ci/npm-cache" NPM_CONFIG_CACHE = "${WORKSPACE}/.ci/npm-cache"
@@ -85,7 +85,7 @@ pipeline {
steps { steps {
sh ''' sh '''
set -euo pipefail set -euo pipefail
npm ci --prefix app npx --yes pnpm@10.15.0 --dir app install --frozen-lockfile
npm run test:mobile-contract --prefix app npm run test:mobile-contract --prefix app
npm run build --prefix app npm run build --prefix app
"$DOTNET" restore tests/dy.net.Tests/dy.net.Tests.csproj --disable-parallel "$DOTNET" restore tests/dy.net.Tests/dy.net.Tests.csproj --disable-parallel
@@ -114,7 +114,11 @@ pipeline {
sh ''' sh '''
set -euo pipefail set -euo pipefail
./scripts/ci-docker.sh buildx rm -f "$BUILDER_NAME" >/dev/null 2>&1 || true ./scripts/ci-docker.sh buildx rm -f "$BUILDER_NAME" >/dev/null 2>&1 || true
./scripts/ci-docker.sh buildx create --name "$BUILDER_NAME" --driver docker-container --driver-opt network=host --use ./scripts/ci-docker.sh buildx create --name "$BUILDER_NAME" --driver docker-container \
--driver-opt network=host \
--driver-opt "env.http_proxy=$HTTP_PROXY_URL" \
--driver-opt "env.https_proxy=$HTTP_PROXY_URL" \
--driver-opt "env.no_proxy=$NO_PROXY_HOSTS" --use
./scripts/ci-docker.sh buildx inspect "$BUILDER_NAME" --bootstrap ./scripts/ci-docker.sh buildx inspect "$BUILDER_NAME" --bootstrap
./scripts/ci-docker.sh buildx build --builder "$BUILDER_NAME" --platform linux/amd64 --network host \ ./scripts/ci-docker.sh buildx build --builder "$BUILDER_NAME" --platform linux/amd64 --network host \
--progress=plain --provenance=false --no-cache --load \ --progress=plain --provenance=false --no-cache --load \