fix: Jenkinsfile
This commit is contained in:
@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.862
|
NEXT_PUBLIC_APP_VERSION=1.6.863
|
||||||
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.862
|
NEXT_PUBLIC_APP_VERSION=1.6.863
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [1.6.863] – 2025-09-08
|
||||||
|
|
||||||
|
- fix: Vereinfacht: Jenkinsfile
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.862] – 2025-09-08
|
## [1.6.862] – 2025-09-08
|
||||||
|
|
||||||
- fix. Jenkinsfile
|
- fix. Jenkinsfile
|
||||||
|
|||||||
116
Jenkinsfile
vendored
116
Jenkinsfile
vendored
@@ -1,64 +1,91 @@
|
|||||||
|
// Jenkinsfile
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent {
|
||||||
tools { nodejs 'node20' }
|
// Wir nutzen das Playwright-Image auch als Build-/Test-Container
|
||||||
|
// (enthält Node, Browser & nötige Deps)
|
||||||
|
docker {
|
||||||
|
image 'mcr.microsoft.com/playwright:v1.54.2-jammy'
|
||||||
|
// optional: args '--user root' falls Rechte benötigt werden
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
options { timestamps() }
|
options {
|
||||||
|
timestamps()
|
||||||
|
ansiColor('xterm')
|
||||||
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
CI = 'true'
|
CI = "true"
|
||||||
NODE_ENV = 'production'
|
NODE_ENV = "production"
|
||||||
NEXT_TELEMETRY_DISABLED = '1'
|
NEXT_TELEMETRY_DISABLED = "1"
|
||||||
PORT = '3000'
|
PORT = "3000"
|
||||||
HUSKY = '0'
|
|
||||||
npm_config_fund = 'false'
|
|
||||||
npm_config_audit = 'false'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Verify mocks') {
|
|
||||||
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
|
// Standard-Checkout; läuft im Container
|
||||||
|
checkout scm
|
||||||
|
|
||||||
|
// LFS & Submodule wie in Woodpecker aktivieren
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eux
|
||||||
echo "[Verify mocks] repo file check"
|
# Falls LFS verwendet wird:
|
||||||
echo "Node available?"; node -v; npm -v
|
if command -v git >/dev/null; then
|
||||||
echo "Check file exists"
|
git lfs install || true
|
||||||
if [ -f mocks/device-cgi-simulator/SERVICE/systemMockData.js ]; then
|
# Submodule + LFS-Dateien sicherstellen
|
||||||
echo 'FOUND'
|
git submodule update --init --recursive || true
|
||||||
else
|
# LFS-Dateien ziehen (falls vorhanden)
|
||||||
echo 'MISSING'; exit 1
|
git lfs fetch || true
|
||||||
|
git lfs checkout || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Debug: kurzer Baumüberblick
|
||||||
|
git status --short || true
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Install & Build') {
|
stage('verify-mocks') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eux
|
||||||
echo 'Install dependencies (incl dev)'
|
pwd
|
||||||
|
node -v && npm -v
|
||||||
|
|
||||||
|
# Husky/prepare überspringen wie im Woodpecker-Job
|
||||||
|
npm ci --ignore-scripts
|
||||||
|
|
||||||
|
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? ==="
|
||||||
|
test -f mocks/device-cgi-simulator/SERVICE/systemMockData.js && echo "FOUND" || (echo "MISSING" && exit 1)
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('e2e-dev') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set -eux
|
||||||
|
node -v && npm -v
|
||||||
|
|
||||||
|
# Husky als devDep nicht ausführen -> npm_config_production=false
|
||||||
env npm_config_production=false npm ci
|
env npm_config_production=false npm ci
|
||||||
echo 'Build app'
|
|
||||||
npm run build
|
npm run build
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('E2E chromium') {
|
# Sim-Server im Hintergrund starten
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
set -eu
|
|
||||||
echo 'Start simulator'
|
|
||||||
npm run server:sim &
|
npm run server:sim &
|
||||||
SIM_PID=$!
|
|
||||||
trap 'echo Stopping simulator; kill $SIM_PID 2>/dev/null || true' EXIT
|
|
||||||
|
|
||||||
echo 'Wait for http://localhost:3000'
|
# Auf Port 3000 warten (ohne curl)
|
||||||
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();"
|
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();"
|
||||||
|
|
||||||
echo 'Ensure chromium available'
|
# Playwright Tests
|
||||||
npx playwright install chromium || true
|
|
||||||
|
|
||||||
echo 'Run tests'
|
|
||||||
npx playwright test --project=chromium
|
npx playwright test --project=chromium
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
@@ -67,13 +94,20 @@ npx playwright test --project=chromium
|
|||||||
|
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
sh 'curl -d "Tests erfolgreich in Jenkins" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35'
|
sh '''
|
||||||
|
set -eux
|
||||||
|
curl -d "Tests erfolgreich in woodpecker" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
sh 'curl -d "Tests fehlgeschlagen in Jenkins" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35'
|
sh '''
|
||||||
|
set -eux
|
||||||
|
curl -d "Tests fehlgeschlagen in woodpecker" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
always {
|
always {
|
||||||
sh 'echo Workspace: $(pwd); ls -1'
|
// Optional: Artefakte, Logs, Playwright-Reports archivieren
|
||||||
|
// archiveArtifacts artifacts: 'playwright-report/**', onlyIfSuccessful: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.862",
|
"version": "1.6.863",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.862",
|
"version": "1.6.863",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@headlessui/react": "^2.2.4",
|
"@headlessui/react": "^2.2.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.862",
|
"version": "1.6.863",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3000",
|
||||||
|
|||||||
Reference in New Issue
Block a user