From 398d13bf1b39cbfff2eb3c016002ec3babfb21f0 Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 8 Sep 2025 08:25:00 +0200 Subject: [PATCH] fix: Vereinfacht: Jenkinsfile --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 ++++ Jenkinsfile | 58 ++++++++++++----------------------------------- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 24 insertions(+), 49 deletions(-) diff --git a/.env.development b/.env.development index ea961cd..7da4ec8 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.861 +NEXT_PUBLIC_APP_VERSION=1.6.862 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 87c1449..c3240b5 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.861 +NEXT_PUBLIC_APP_VERSION=1.6.862 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 220a2d9..486f013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.862] – 2025-09-08 + +- fix. Jenkinsfile + +--- ## [1.6.861] – 2025-09-08 - test: Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile index 3a14cc0..93bf67e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,4 @@ pipeline { - // Fallback Variante ohne Docker-Plugin (agent any) agent any tools { nodejs 'node20' } @@ -10,49 +9,19 @@ pipeline { NODE_ENV = 'production' NEXT_TELEMETRY_DISABLED = '1' PORT = '3000' - HUSKY = '0' // Husky Hooks im CI deaktivieren + HUSKY = '0' npm_config_fund = 'false' npm_config_audit = 'false' } stages { - stage('Self-check Jenkinsfile version') { - steps { - sh ''' -set -eu -echo '==== Showing first lines of Jenkinsfile (debug) ====' -head -n 40 Jenkinsfile || true -echo 'Git commit:' -git rev-parse --short HEAD || true -uname -a || true -which node || true - ''' - } - } - - stage('Versions') { - steps { - sh ''' -set -eu -node -v && npm -v -npx playwright --version || true - ''' - } - } - stage('Verify mocks') { steps { sh ''' set -eu -echo "[Verify mocks] working dir: $(pwd)" -node -v && npm -v -echo "HUSKY=$HUSKY" -npm ci -echo "=== git ls-files ===" -git ls-files | grep -i '^mocks/device-cgi-simulator/SERVICE/systemMockData.js' || true -echo "=== ls -la ===" -ls -la mocks/device-cgi-simulator/SERVICE || true -echo "=== file exists? ===" +echo "[Verify mocks] repo file check" +echo "Node available?"; node -v; npm -v +echo "Check file exists" if [ -f mocks/device-cgi-simulator/SERVICE/systemMockData.js ]; then echo 'FOUND' else @@ -62,35 +31,36 @@ fi } } - stage('Build') { + stage('Install & Build') { steps { - sh ''' + sh ''' set -eu +echo 'Install dependencies (incl dev)' env npm_config_production=false npm ci +echo 'Build app' npm run build - ''' + ''' } } stage('E2E chromium') { steps { - sh ''' + sh ''' set -eu echo 'Start simulator' npm run server:sim & SIM_PID=$! - trap 'echo Stopping simulator; kill $SIM_PID 2>/dev/null || true' EXIT -echo 'Waiting for http://localhost:3000' +echo 'Wait for http://localhost:3000' node -e "const http=require('http');let n=120;function ping(){http.get('http://localhost:3000',res=>{console.log('Server is up');process.exit(0)}).on('error',()=>{if(n--<=0){console.error('Server did not start');process.exit(1)}setTimeout(ping,1000)});}ping();" -# Playwright Browser installieren (best-effort) +echo 'Ensure chromium available' npx playwright install chromium || true -echo 'Run tests (chromium)' +echo 'Run tests' npx playwright test --project=chromium - ''' + ''' } } } diff --git a/package-lock.json b/package-lock.json index b1508af..c204332 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.861", + "version": "1.6.862", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.861", + "version": "1.6.862", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index db416a0..6ed890a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.861", + "version": "1.6.862", "private": true, "scripts": { "dev": "next dev -p 3000",