From c9f57ab8efc0c91d66ab63d38df2bca01d1cf443 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 12:45:36 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.uat | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .env.uat diff --git a/.env.development b/.env.development index 66db44e..50418eb 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -VITE_BASE_URL = 'http://localhost:5157' \ No newline at end of file +VITE_BASE_URL = 'http://192.168.123.199:5155' \ No newline at end of file diff --git a/.env.uat b/.env.uat new file mode 100644 index 0000000..cd1677d --- /dev/null +++ b/.env.uat @@ -0,0 +1 @@ +VITE_BASE_URL = 'http://192.168.123.199:5156' \ No newline at end of file From 2d3512ac4ccbc815fd3375c4ca815167ec52dc53 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 12:55:14 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-dev | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Jenkinsfile-dev diff --git a/Jenkinsfile-dev b/Jenkinsfile-dev new file mode 100644 index 0000000..f4793b6 --- /dev/null +++ b/Jenkinsfile-dev @@ -0,0 +1,89 @@ +pipeline { + agent none // 全局不指定,局部单独声明 + environment { + IMAGE_NAME = 'lpt-fe:0.0' + CONTAINER_NAME = 'LPT_FE' + HOST_PORT = '8155' + CONTAINER_PORT = '80' + } + stages { + stage('Install Dependencies') { + agent { + docker { + image 'node:20-alpine' + args '-v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules' + } + } + steps { + sh ''' + npm config set cache /.npm + npm install + ''' + } + } + + stage('Type Check & Build') { + agent { + docker { + image 'node:20-alpine' + args '-v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules' + } + } + steps { + sh ''' + npm run type-check + npm run build + ''' + } + } + + stage('Build Docker Image') { + agent any // Jenkins默认节点,有Docker命令 + steps { + sh ''' + docker build -t $IMAGE_NAME . + ''' + } + } + + stage('Run Docker Container') { + agent any + steps { + sh ''' + docker rm -f $CONTAINER_NAME || true + docker run -d --name $CONTAINER_NAME \\ + -p $HOST_PORT:$CONTAINER_PORT \\ + --health-cmd="curl -f http://localhost:80 || exit 1" \\ + --health-interval=5s \\ + --health-retries=3 \\ + --restart=always \\ + $IMAGE_NAME + ''' + } + } + + stage('Check Docker Status') { + agent any + steps { + script { + def lastStatus = '' + timeout(time: 60, unit: 'SECONDS') { + waitUntil { + def status = sh( + script: "docker inspect -f '{{.State.Health.Status}}' $CONTAINER_NAME || echo 'unhealthy'", + returnStdout: true + ).trim() + + if (status != lastStatus) { + echo "Container health: ${status}" + lastStatus = status + } + + return (status == 'healthy') + } + } + } + } + } + } +} From 7e7f40efd36b2a622e494f40477ca7f6bccb18df Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 13:02:54 +0800 Subject: [PATCH 3/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-dev b/Jenkinsfile-dev index f4793b6..5ff3f38 100644 --- a/Jenkinsfile-dev +++ b/Jenkinsfile-dev @@ -32,7 +32,7 @@ pipeline { steps { sh ''' npm run type-check - npm run build + npm run dev ''' } } From 134b09780bc5577a4461e9d0d217408d332f3366 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 13:06:08 +0800 Subject: [PATCH 4/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-dev b/Jenkinsfile-dev index 5ff3f38..9469227 100644 --- a/Jenkinsfile-dev +++ b/Jenkinsfile-dev @@ -32,7 +32,7 @@ pipeline { steps { sh ''' npm run type-check - npm run dev + npm run build:dev ''' } } From d418d463de62024accecd398a7e2d3b00e238d32 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 13:10:28 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 28b5603..51afe91 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "dev": "vite --mode development", + "build:dev": "vite build --mode development", "build": "vite build --mode production", "preview": "vite preview", "build-only": "vite build", From 39c9d14c9ca3c70802bfc9344888a506cdd58751 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 26 Oct 2025 13:36:47 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AEprod=E7=9A=84?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2f868d6..d0cf43f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { environment { IMAGE_NAME = 'lpt-fe:0.0' CONTAINER_NAME = 'LPT_FE' - HOST_PORT = '5158' + HOST_PORT = '8157' CONTAINER_PORT = '80' } stages { From 3150b2d89e8f670517cd8811bf44836cb54469ff Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sun, 2 Nov 2025 21:45:58 +0800 Subject: [PATCH 7/7] =?UTF-8?q?feat(N/A):=E9=85=8D=E7=BD=AEDockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6f55a2e..d876b6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM nginx:alpine RUN apk add --no-cache curl COPY dist/ /usr/share/nginx/html/ - +RUN chmod -R 755 /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80