This commit is contained in:
2026-02-27 22:05:44 +01:00
parent 8287def29e
commit 6512edd041
3 changed files with 44 additions and 24 deletions

View File

@@ -26,9 +26,9 @@ build-rag:
- rag-service/target/*.jar - rag-service/target/*.jar
expire_in: 1h expire_in: 1h
rules: rules:
- changes:
- rag-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-service/**/*
build-gateway: build-gateway:
stage: build stage: build
@@ -46,9 +46,9 @@ build-gateway:
- gateway-service/target/*.jar - gateway-service/target/*.jar
expire_in: 1h expire_in: 1h
rules: rules:
- changes:
- gateway-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- gateway-service/**/*
build-analytics: build-analytics:
stage: build stage: build
@@ -66,9 +66,9 @@ build-analytics:
- analytics-service/target/*.jar - analytics-service/target/*.jar
expire_in: 1h expire_in: 1h
rules: rules:
- changes:
- analytics-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- analytics-service/**/*
build-rag-view: build-rag-view:
stage: build stage: build
@@ -86,9 +86,9 @@ build-rag-view:
- rag-view/dist - rag-view/dist
expire_in: 1h expire_in: 1h
rules: rules:
- changes:
- rag-view/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-view/**/*
# ══════════════════════════════════════════════════════════ # ══════════════════════════════════════════════════════════
# PUBLISH DOCKER IMAGES # PUBLISH DOCKER IMAGES
@@ -109,9 +109,9 @@ publish-rag:
- docker push $REGISTRY/rag-service:latest - docker push $REGISTRY/rag-service:latest
needs: [build-rag] needs: [build-rag]
rules: rules:
- changes:
- rag-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-service/**/*
publish-gateway: publish-gateway:
stage: publish stage: publish
@@ -128,9 +128,9 @@ publish-gateway:
- docker push $REGISTRY/gateway-service:latest - docker push $REGISTRY/gateway-service:latest
needs: [build-gateway] needs: [build-gateway]
rules: rules:
- changes:
- gateway-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- gateway-service/**/*
publish-analytics: publish-analytics:
stage: publish stage: publish
@@ -147,9 +147,9 @@ publish-analytics:
- docker push $REGISTRY/analytics-service:latest - docker push $REGISTRY/analytics-service:latest
needs: [build-analytics] needs: [build-analytics]
rules: rules:
- changes:
- analytics-service/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- analytics-service/**/*
publish-rag-view: publish-rag-view:
stage: publish stage: publish
@@ -166,9 +166,9 @@ publish-rag-view:
- docker push $REGISTRY/rag-view:latest - docker push $REGISTRY/rag-view:latest
needs: [build-rag-view] needs: [build-rag-view]
rules: rules:
- changes:
- rag-view/**/*
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-view/**/*
# ══════════════════════════════════════════════════════════ # ══════════════════════════════════════════════════════════
# DEPLOY TO VPS # DEPLOY TO VPS
@@ -177,8 +177,6 @@ publish-rag-view:
.deploy_template: &deploy_setup .deploy_template: &deploy_setup
stage: deploy stage: deploy
image: alpine:3.20 image: alpine:3.20
only:
- main
before_script: before_script:
- apk add --no-cache openssh-client - apk add --no-cache openssh-client
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
@@ -192,6 +190,10 @@ publish-rag-view:
deploy-rag: deploy-rag:
<<: *deploy_setup <<: *deploy_setup
needs: [publish-rag] needs: [publish-rag]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-service/**/*
script: script:
- | - |
ssh $VPS_USER@$VPS_HOST << ENDSSH ssh $VPS_USER@$VPS_HOST << ENDSSH
@@ -207,6 +209,10 @@ deploy-rag:
deploy-gateway: deploy-gateway:
<<: *deploy_setup <<: *deploy_setup
needs: [publish-gateway] needs: [publish-gateway]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- gateway-service/**/*
script: script:
- | - |
ssh $VPS_USER@$VPS_HOST << ENDSSH ssh $VPS_USER@$VPS_HOST << ENDSSH
@@ -222,6 +228,10 @@ deploy-gateway:
deploy-analytics: deploy-analytics:
<<: *deploy_setup <<: *deploy_setup
needs: [publish-analytics] needs: [publish-analytics]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- analytics-service/**/*
script: script:
- | - |
ssh $VPS_USER@$VPS_HOST << ENDSSH ssh $VPS_USER@$VPS_HOST << ENDSSH
@@ -237,6 +247,10 @@ deploy-analytics:
deploy-rag-view: deploy-rag-view:
<<: *deploy_setup <<: *deploy_setup
needs: [publish-rag-view] needs: [publish-rag-view]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- rag-view/**/*
script: script:
- | - |
ssh $VPS_USER@$VPS_HOST << ENDSSH ssh $VPS_USER@$VPS_HOST << ENDSSH
@@ -252,8 +266,10 @@ deploy-rag-view:
# Deploy all services at once (manual trigger) # Deploy all services at once (manual trigger)
deploy-all: deploy-all:
<<: *deploy_setup <<: *deploy_setup
needs: [publish-rag, publish-gateway, publish-analytics] rules:
- if: $CI_COMMIT_BRANCH == "main"
when: manual when: manual
needs: []
script: script:
- | - |
ssh $VPS_USER@$VPS_HOST << ENDSSH ssh $VPS_USER@$VPS_HOST << ENDSSH

View File

@@ -1 +0,0 @@
VITE_API_BASE_URL=https://balexvic.com

View File

@@ -4,4 +4,9 @@ import react from "@vitejs/plugin-react";
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
base: "/ragview/", base: "/ragview/",
define: {
"import.meta.env.VITE_API_BASE_URL": JSON.stringify(
process.env.VITE_API_BASE_URL || "https://balexvic.com"
),
},
}); });