Upload artifacts to ci.
Some checks reported errors
farmcontrol/farmcontrol-ui/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
Tom Butcher 2025-12-28 18:04:32 +00:00
parent 375e32a356
commit 21f61229e4

76
Jenkinsfile vendored
View File

@ -20,54 +20,44 @@ def deploy() {
def buildOnLabel(label, buildCommand) {
return {
node(label) {
try {
stage("Checkout (${label})") {
checkout scm
}
stage("Checkout (${label})") {
checkout scm
}
stage("Setup Node.js (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh 'node -v'
sh 'yarn -v'
} else {
bat 'node -v'
bat 'yarn -v'
}
}
}
stage("Install Dependencies (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh 'yarn install --frozen-lockfile --production=false'
} else {
bat 'yarn install --frozen-lockfile --production=false'
}
}
}
stage("Build (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh "NODE_ENV=production ${buildCommand}"
sh 'ls -la build || echo "Build directory not found"'
} else {
bat "set NODE_ENV=production && ${buildCommand}"
bat 'if not exist build echo "Build directory not found"'
}
}
}
stage("Verify Build (${label})") {
stage("Setup Node.js (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh 'test -d build || (echo "Build directory does not exist" && exit 1)'
sh 'node -v'
sh 'yarn -v'
} else {
bat 'if not exist build (echo "Build directory does not exist" && exit 1)'
bat 'node -v'
bat 'yarn -v'
}
}
} finally {
cleanWs()
}
stage("Install Dependencies (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh 'yarn install --frozen-lockfile --production=false'
} else {
bat 'yarn install --frozen-lockfile --production=false'
}
}
}
stage("Build (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh "NODE_ENV=production ${buildCommand}"
} else {
bat "set NODE_ENV=production && ${buildCommand}"
}
}
}
stage("Archive Artifacts (${label})") {
archiveArtifacts artifacts: 'app_dist/**/*.dmg, app_dist/**/*.exe', fingerprint: true
}
}
}