From 7900933f522101ce2fc1fa3f12edfcd0bd5265a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B1=89=E5=8D=8E?= Date: Tue, 5 Mar 2024 10:56:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index 133cfd8..313d395 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,6 @@ { + "compilerOptions": { + "jsx": "react" + }, "extends": "./src/.umi/tsconfig.json" } From fc548717bf11738d1bdb496a9ab2b5903d0e4814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B1=89=E5=8D=8E?= Date: Tue, 5 Mar 2024 10:59:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.umirc.ts b/.umirc.ts index b5d9e1f..aa062a3 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -6,7 +6,7 @@ export default defineConfig({ favicons: ['/assets/logo.jpg'], access: {}, model: {}, - outputPath: pkg.name, + // outputPath: pkg.name, initialState: {}, layout: false, qiankun: { From 98e6aef9039d20d9a72b0f8e530f70e90469b67c Mon Sep 17 00:00:00 2001 From: xlx Date: Tue, 5 Mar 2024 11:15:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feta:=E6=B7=BB=E5=8A=A0ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 5 +++++ deploy/build.sh | 9 +++++++++ deploy/package.sh | 10 ++++++++++ 4 files changed, 56 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile create mode 100755 deploy/build.sh create mode 100644 deploy/package.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5155b1b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,32 @@ +stages: + - build + - package + - deploy + +cache: + policy: pull + key: '$CI_COMMIT_REF_NAME' + paths: + - node_modules/ + +build: + image: registry.zhst.com/video-analysis/pnpm4 + tags: + - linux + stage: build + script: + - chmod +x ./deploy/build.sh && ./deploy/build.sh + artifacts: + name: '${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}_${CI_PIPELINE_ID}' + paths: + - ./app/public/* + +package: + tags: + - linux_shell + stage: package + script: + - chmod +x ./deploy/package.sh && ./deploy/package.sh + dependencies: + - build + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..123c217 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine:latest + +ADD ./app/public/ /app/public/ + +CMD [ "sh", "-c", "while true; do echo zhst-web; sleep 1; done" ] \ No newline at end of file diff --git a/deploy/build.sh b/deploy/build.sh new file mode 100755 index 0000000..00a1980 --- /dev/null +++ b/deploy/build.sh @@ -0,0 +1,9 @@ +pnpm install + +pnpm run build:master + +mkdir -p ./app/public/ + +mv ./dist/* ./app/public/ + +cat ./app/public/index.html | head -n 7 diff --git a/deploy/package.sh b/deploy/package.sh new file mode 100644 index 0000000..74c068d --- /dev/null +++ b/deploy/package.sh @@ -0,0 +1,10 @@ +#! /bin/bash +set -e + +export DOCKER_CLI_EXPERIMENTAL=enabled +docker login registry.zhst.com -u zhst -p Zhst666\& + +# docker build -t registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID} -f Dockerfile . +# docker push registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID} +docker buildx build --platform linux/arm64,linux/amd64 -t registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID} -f Dockerfile . --push +