build: 前端应用部署。
Some checks are pending
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Test (windows-latest) (push) Waiting to run
CI / Lint (ubuntu-latest) (push) Waiting to run
CI / Lint (windows-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / CI OK (push) Blocked by required conditions
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Deploy Website on push / Deploy Push Playground Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Docs Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Antd Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Element Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Naive Ftp (push) Waiting to run
Deploy Website on push / Rerun on failure (push) Blocked by required conditions
Release Drafter / update_release_draft (push) Waiting to run

This commit is contained in:
jiangdingxuan
2025-08-21 10:12:47 +08:00
parent c447145d62
commit d9fe6449c5
6 changed files with 69 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
node_modules **/node_modules
.git .git
.gitignore .gitignore
*.md *.md
dist **/dist
.turbo .turbo
dist.zip dist.zip

39
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('build') {
steps {
script {
file_contents = '''
VITE_GLOB_API_URL=${env.VITE_GLOB_API_URL}
'''
write_file_path = "apps/web-$pomPath/.env.production.local"
writeFile file: write_file_path, text: file_contents, encoding: 'UTF-8'
}
script{
sh "docker build -f apps/web-$pomPath/Dockerfile --build-arg BASE_URI=$BASE_URI -t $IMAGE_PATH ."
}
}
}
stage('deploy') {
steps {
script{
sh 'docker push $IMAGE_PATH'
}
}
}
}
post {
success {
sh """
curl -X POST "${params.API_URL}/success"
"""
}
failure {
sh """
curl -X POST "${params.API_URL}/failure"
"""
}
}
}

21
apps/web-antd/Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM node:lts-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV NODE_ENV=production
ARG NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
RUN npm config set registry ${NPM_CONFIG_REGISTRY}
RUN corepack enable
WORKDIR /app
FROM base AS builder
COPY . .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --frozen-lockfile
ARG RELATIVE_PATH=/
ARG BASE_URI=
RUN pnpm run build:antd -- --base=${RELATIVE_PATH}${BASE_URI}
FROM nginx:stable-alpine
ARG BASE_URI=
COPY --from=builder /app/apps/web-antd/dist /usr/share/nginx/html/${BASE_URI}
COPY --from=builder /app/scripts/deploy/nginx.conf /etc/nginx/nginx.conf
EXPOSE 8080

View File

@@ -1,2 +1,2 @@
export { default as Tinyflow } from './tinyflow.vue'; export { default as Tinyflow } from './Tinyflow.vue';
export * from './ui/typing'; export * from './ui/typing';

View File

@@ -10,7 +10,7 @@ import { isNumber } from '@vben/utils';
import { Button, Input, Select } from 'ant-design-vue'; import { Button, Input, Select } from 'ant-design-vue';
import { testWorkflow } from '#/api/ai/workflow'; import { testWorkflow } from '#/api/ai/workflow';
import { Tinyflow } from '#/components/tinyflow'; import { Tinyflow } from '#/components/Tinyflow';
defineProps<{ defineProps<{
provider: any; provider: any;

View File

@@ -1,16 +1,17 @@
import { defineConfig } from '@vben/vite-config'; import { defineConfig } from '@vben/vite-config';
import { loadEnv } from 'vite';
export default defineConfig(async () => { export default defineConfig(async ({ mode }) => {
const env = loadEnv(mode, process.cwd());
return { return {
application: {}, application: {},
vite: { vite: {
server: { server: {
proxy: { proxy: {
'/admin-api': { [env.VITE_GLOB_API_URL]: {
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/admin-api/, ''),
// mock代理目标地址 // mock代理目标地址
target: 'http://localhost:48080/admin-api', target: env.VITE_BASE_URL,
ws: true, ws: true,
}, },
}, },