|
|
|
@@ -1,77 +1,18 @@
|
|
|
|
|
kind: pipeline
|
|
|
|
|
name: default
|
|
|
|
|
|
|
|
|
|
clone:
|
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: clone-cbt-ui
|
|
|
|
|
image: docker.freeicu.top/alpine/git:latest
|
|
|
|
|
commands:
|
|
|
|
|
- >
|
|
|
|
|
git clone
|
|
|
|
|
-b proj-shopee-test
|
|
|
|
|
--depth 1
|
|
|
|
|
--no-tags
|
|
|
|
|
https://zwzeng:glpat-nuzkafsdgYKM0KAgvpL4Bm86MQp1OnkH.01.0w0tr4xa1@git.ittx.com.cn/cybertrans/frontend/cbt-ui.git
|
|
|
|
|
|
|
|
|
|
- name: build-cbt-ui
|
|
|
|
|
image: docker.freeicu.top/library/node:22-alpine
|
|
|
|
|
pull: if-not-exists
|
|
|
|
|
environment:
|
|
|
|
|
NPM_USERNAME:
|
|
|
|
|
from_secret: nexus_username
|
|
|
|
|
NPM_PASSWORD:
|
|
|
|
|
from_secret: nexus_password
|
|
|
|
|
CBT_BUILD_OUTPUT_DIR: dist/release
|
|
|
|
|
commands:
|
|
|
|
|
- >
|
|
|
|
|
test -w /cache ||
|
|
|
|
|
(echo "Cache directory /cache is not mounted or writable" && exit 1)
|
|
|
|
|
- cd cbt-ui
|
|
|
|
|
- >
|
|
|
|
|
sed -i
|
|
|
|
|
's#https://dl-cdn.alpinelinux.org/alpine#https://mirrors.aliyun.com/alpine#'
|
|
|
|
|
/etc/apk/repositories
|
|
|
|
|
- apk add --no-cache expect
|
|
|
|
|
- corepack enable
|
|
|
|
|
- |
|
|
|
|
|
node <<'NODE'
|
|
|
|
|
const fs = require('fs')
|
|
|
|
|
const workspacePath = 'pnpm-workspace.yaml'
|
|
|
|
|
const workspace = fs.readFileSync(workspacePath, 'utf8')
|
|
|
|
|
const updated = workspace.replace(
|
|
|
|
|
/: set this to true or false$/gm,
|
|
|
|
|
': true',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if (updated === workspace) {
|
|
|
|
|
throw new Error('pnpm-workspace.yaml has no allowBuilds placeholders')
|
|
|
|
|
}
|
|
|
|
|
fs.writeFileSync(workspacePath, updated)
|
|
|
|
|
NODE
|
|
|
|
|
- pnpm config set store-dir /cache/cbt-ui/pnpm-store
|
|
|
|
|
- sh install.sh
|
|
|
|
|
- pnpm build:wes
|
|
|
|
|
- test -f dist/release/index.html
|
|
|
|
|
- >
|
|
|
|
|
sed -i
|
|
|
|
|
's#registry-vpc.cn-hangzhou.aliyuncs.com#registry.cn-hangzhou.aliyuncs.com#'
|
|
|
|
|
Dockerfile
|
|
|
|
|
|
|
|
|
|
- name: package-cbt-ui
|
|
|
|
|
image: docker.freeicu.top/plugins/docker:latest
|
|
|
|
|
# docker 打包
|
|
|
|
|
- name: docker
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
settings:
|
|
|
|
|
context: ./cbt-ui
|
|
|
|
|
dockerfile: ./cbt-ui/Dockerfile
|
|
|
|
|
registry: registry.cn-hangzhou.aliyuncs.com
|
|
|
|
|
repo: registry.cn-hangzhou.aliyuncs.com/loghub/wes
|
|
|
|
|
tags:
|
|
|
|
|
- shopee-ui-test-1
|
|
|
|
|
cache_from:
|
|
|
|
|
- registry.cn-hangzhou.aliyuncs.com/loghub/wes:shopee-ui-test-1
|
|
|
|
|
context: ./
|
|
|
|
|
dockerfile: ./Dockerfile
|
|
|
|
|
username:
|
|
|
|
|
from_secret: docker_username
|
|
|
|
|
password:
|
|
|
|
|
from_secret: docker_password
|
|
|
|
|
purge: true
|
|
|
|
|
registry: https://registry.cn-hangzhou.aliyuncs.com
|
|
|
|
|
repo: registry.cn-hangzhou.aliyuncs.com/loghub/redis
|
|
|
|
|
tags:
|
|
|
|
|
- 8
|
|
|
|
|