Update .gitlab-ci.yml file
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# -----------------------------------------
|
||||
# USBcheck.it – GitLab CI/CD Pipeline
|
||||
# Build: pnpm
|
||||
# Deploy: FTPS (lftp) → all-inkl
|
||||
# -----------------------------------------
|
||||
|
||||
stages:
|
||||
- install
|
||||
- build
|
||||
@@ -7,7 +13,9 @@ variables:
|
||||
NODE_ENV: production
|
||||
BUILD_DIR: dist
|
||||
|
||||
# Gemeinsames pnpm-Setup für alle Node-Jobs
|
||||
# -----------------------------------------
|
||||
# Gemeinsames Setup für Node + pnpm
|
||||
# -----------------------------------------
|
||||
.node_pnpm: &node_pnpm
|
||||
image: node:20-bullseye
|
||||
before_script:
|
||||
@@ -16,13 +24,17 @@ variables:
|
||||
- corepack prepare pnpm@9.12.0 --activate
|
||||
- pnpm -v
|
||||
|
||||
# Cache node_modules für schnellere Builds
|
||||
# -----------------------------------------
|
||||
# Cache für node_modules
|
||||
# -----------------------------------------
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- node_modules/
|
||||
|
||||
# 1) Dependencies installieren
|
||||
# -----------------------------------------
|
||||
# 1. Install dependencies
|
||||
# -----------------------------------------
|
||||
install:
|
||||
stage: install
|
||||
<<: *node_pnpm
|
||||
@@ -34,10 +46,14 @@ install:
|
||||
- node_modules/
|
||||
expire_in: 1h
|
||||
|
||||
# 2) Build erzeugen
|
||||
# -----------------------------------------
|
||||
# 2. Build project
|
||||
# -----------------------------------------
|
||||
build:
|
||||
stage: build
|
||||
<<: *node_pnpm
|
||||
dependencies:
|
||||
- install
|
||||
script:
|
||||
- echo "🏗️ Building..."
|
||||
- pnpm build
|
||||
@@ -47,17 +63,23 @@ build:
|
||||
- ${BUILD_DIR}/
|
||||
expire_in: 1 week
|
||||
|
||||
# 3) Template für FTPS-Deploy (lftp)
|
||||
# -----------------------------------------
|
||||
# 3. Template für FTPS Deployment
|
||||
# -----------------------------------------
|
||||
.deploy_ftps_template: &deploy_ftps
|
||||
stage: deploy
|
||||
image: alpine:3.20
|
||||
dependencies:
|
||||
- build # <<< sehr wichtig: Lade Build-Artefakte
|
||||
before_script:
|
||||
- echo "📡 Installing lftp..."
|
||||
- apk add --no-cache lftp
|
||||
script:
|
||||
- echo "🚀 Deploy via FTPS to $FTP_HOST:$FTP_PATH ..."
|
||||
- lftp -e "
|
||||
set ftp:ssl-force true;
|
||||
set ftp:passive-mode true;
|
||||
set ftp:ssl-protect-data true;
|
||||
set ssl:verify-certificate no;
|
||||
open -u $FTP_USER,$FTP_PASSWORD $FTP_HOST;
|
||||
mirror -R --delete --parallel=4 ${BUILD_DIR}/ $FTP_PATH;
|
||||
@@ -65,7 +87,9 @@ build:
|
||||
"
|
||||
- echo "✅ Deploy finished."
|
||||
|
||||
# 3a) Staging-Deployment
|
||||
# -----------------------------------------
|
||||
# 3a. Staging Deployment
|
||||
# -----------------------------------------
|
||||
deploy:staging:
|
||||
<<: *deploy_ftps
|
||||
variables:
|
||||
@@ -77,7 +101,9 @@ deploy:staging:
|
||||
- develop
|
||||
- merge_requests
|
||||
|
||||
# 3b) Production-Deployment
|
||||
# -----------------------------------------
|
||||
# 3b. Production Deployment
|
||||
# -----------------------------------------
|
||||
deploy:production:
|
||||
<<: *deploy_ftps
|
||||
variables:
|
||||
|
||||
Reference in New Issue
Block a user