fix: Jenkinsfile
This commit is contained in:
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@@ -21,15 +21,32 @@ pipeline {
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Self-check Jenkinsfile version') {
|
||||
steps {
|
||||
sh '''#!/bin/bash
|
||||
set -euo pipefail
|
||||
echo '==== Showing first lines of Jenkinsfile (debug) ===='
|
||||
head -n 40 Jenkinsfile || true
|
||||
echo 'Git commit:'
|
||||
git rev-parse --short HEAD || true
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Versions') {
|
||||
steps {
|
||||
sh 'node -v && npm -v && npx playwright --version'
|
||||
sh '''#!/bin/bash
|
||||
set -euo pipefail
|
||||
node -v && npm -v
|
||||
npx playwright --version || true
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Verify mocks') {
|
||||
steps {
|
||||
sh '''bash -euo pipefail <<'EOF'
|
||||
sh '''#!/bin/bash
|
||||
set -euo pipefail
|
||||
echo "[Verify mocks] working dir: $(pwd)"
|
||||
node -v && npm -v
|
||||
echo "HUSKY=$HUSKY"
|
||||
@@ -39,27 +56,29 @@ git ls-files | grep -i '^mocks/device-cgi-simulator/SERVICE/systemMockData.js' |
|
||||
echo "=== ls -la ==="
|
||||
ls -la mocks/device-cgi-simulator/SERVICE || true
|
||||
echo "=== file exists? ==="
|
||||
if [ -f mocks/device-cgi-simulator/SERVICE/systemMockData.js ]; then
|
||||
if [[ -f mocks/device-cgi-simulator/SERVICE/systemMockData.js ]]; then
|
||||
echo 'FOUND'
|
||||
else
|
||||
echo 'MISSING'; exit 1
|
||||
fi
|
||||
EOF"""
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh '''bash -euo pipefail <<'EOF'
|
||||
sh '''#!/bin/bash
|
||||
set -euo pipefail
|
||||
env npm_config_production=false npm ci
|
||||
npm run build
|
||||
EOF"""
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('E2E chromium') {
|
||||
steps {
|
||||
sh '''bash -euo pipefail <<'EOF'
|
||||
sh '''#!/bin/bash
|
||||
set -euo pipefail
|
||||
echo 'Start simulator'
|
||||
npm run server:sim &
|
||||
SIM_PID=$!
|
||||
@@ -78,7 +97,7 @@ npx playwright install --with-deps chromium || true
|
||||
|
||||
echo 'Run tests (chromium)'
|
||||
npx playwright test --project=chromium
|
||||
EOF"""
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user