feat: настройка CI/CD деплоя через ci-templates
Добавлены service.yaml, .drone.yml и корневой package.json с workspaces. Обновлён vite.config.ts (code splitting: antd, x6), .gitignore (.ci, .claude, .serena). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
40
.drone.yml
Normal file
40
.drone.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: kubernetes
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: prepare
|
||||||
|
image: alpine:3.19
|
||||||
|
environment:
|
||||||
|
GITEA_TOKEN:
|
||||||
|
from_secret: GITEA_TOKEN
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache git bash yq
|
||||||
|
- git clone --depth 1 https://token:$GITEA_TOKEN@git.vigdorov.ru/vigdorov/ci-templates.git .ci
|
||||||
|
- chmod +x .ci/scripts/*.sh
|
||||||
|
- bash .ci/scripts/prepare.sh
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: gcr.io/kaniko-project/executor:v1.23.2-debug
|
||||||
|
depends_on: [prepare]
|
||||||
|
environment:
|
||||||
|
HARBOR_USER:
|
||||||
|
from_secret: HARBOR_USER
|
||||||
|
HARBOR_PASSWORD:
|
||||||
|
from_secret: HARBOR_PASSWORD
|
||||||
|
commands:
|
||||||
|
- /busybox/sh .ci/scripts/build.sh
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
image: alpine:3.19
|
||||||
|
depends_on: [build]
|
||||||
|
environment:
|
||||||
|
KUBE_CONFIG:
|
||||||
|
from_secret: KUBE_CONFIG
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache bash yq kubectl helm
|
||||||
|
- bash .ci/scripts/deploy.sh
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch: [master, main]
|
||||||
|
event: [push, custom]
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,3 +7,6 @@ dist-ssr
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
*.sw?
|
*.sw?
|
||||||
|
.ci
|
||||||
|
.claude
|
||||||
|
.serena
|
||||||
|
|||||||
@ -31,6 +31,15 @@ test-x6/
|
|||||||
└── ARCHITECTURE.md # Детальная архитектура
|
└── ARCHITECTURE.md # Детальная архитектура
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Деплой
|
||||||
|
|
||||||
|
- **Namespace:** test-x6 (отдельный)
|
||||||
|
- **CI/CD:** Drone CI через ci-templates (service.yaml + .drone.yml)
|
||||||
|
- **Тип:** web-frontend (SPA → nginx)
|
||||||
|
- **Registry:** registry.vigdorov.ru/library/test-x6
|
||||||
|
- **Домен:** test-x6.vigdorov.ru
|
||||||
|
- **Trigger:** push в main
|
||||||
|
|
||||||
## Ключевые документы
|
## Ключевые документы
|
||||||
|
|
||||||
- `ARCHITECTURE.md` — архитектура, модель данных, API, фазы реализации
|
- `ARCHITECTURE.md` — архитектура, модель данных, API, фазы реализации
|
||||||
|
|||||||
@ -1,7 +1,16 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: {
|
||||||
|
antd: ['antd', '@ant-design/icons'],
|
||||||
|
x6: ['@antv/x6', '@antv/x6-react-shape'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
5
package.json
Normal file
5
package.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "test-x6",
|
||||||
|
"private": true,
|
||||||
|
"workspaces": ["frontend"]
|
||||||
|
}
|
||||||
7
service.yaml
Normal file
7
service.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
service:
|
||||||
|
name: test-x6
|
||||||
|
type: web-frontend
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
namespace: test-x6
|
||||||
|
domain: test-x6.vigdorov.ru
|
||||||
Reference in New Issue
Block a user