- 更新 build-and-deploy 阶段使用 *tools_image - 重构 Dockerfile.tools: 基于 node:20-alpine,添加 git/ssh/rsync/curl/dig/nc - 镜像大小: 60.5MB (包含 Node.js 20 + 所有工具) - 移除临时安装 SSH/rsync 的步骤
This commit is contained in:
+7
-4
@@ -113,7 +113,7 @@ steps:
|
||||
- dev
|
||||
|
||||
build-and-deploy:
|
||||
image: *node_image
|
||||
image: *tools_image
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
NEXT_TELEMETRY_DISABLED: 1
|
||||
@@ -124,9 +124,12 @@ steps:
|
||||
- lint
|
||||
- type-check
|
||||
commands:
|
||||
- echo "Checking SSH client availability"
|
||||
- which ssh && echo "SSH client found" || echo "Installing SSH client"
|
||||
- apk add --no-cache openssh-client rsync
|
||||
- echo "=== 构建并部署到生产环境 ==="
|
||||
- echo "当前容器信息:"
|
||||
- 'echo "主机名: $(hostname)"'
|
||||
- 'echo "IP地址: $(hostname -i)"'
|
||||
- 'echo "可用工具: $(which ssh rsync git curl dig nc)"'
|
||||
- echo ""
|
||||
- echo "Building production artifacts"
|
||||
- npm run build
|
||||
- echo "Build completed"
|
||||
|
||||
Reference in New Issue
Block a user