Fixed deploy stage.
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit

This commit is contained in:
Tom Butcher 2025-12-28 17:47:00 +00:00
parent e74d88d286
commit 375e32a356

13
Jenkinsfile vendored
View File

@ -4,8 +4,8 @@ def deploy() {
stage('Deploy (Ubuntu)') {
checkout scm
nodejs(nodeJSInstallationName: 'Node23') {
sh 'yarn install --frozen-lockfile'
sh 'yarn build'
sh 'yarn install --frozen-lockfile --production=false'
sh 'NODE_ENV=production yarn build'
// Deploy to Cloudflare Pages using wrangler
// CLOUDFLARE_API_TOKEN should be set as a Jenkins credential/env variable
sh 'npx wrangler pages deploy build'
@ -20,7 +20,6 @@ def deploy() {
def buildOnLabel(label, buildCommand) {
return {
node(label) {
env.NODE_ENV = 'production'
try {
stage("Checkout (${label})") {
checkout scm
@ -41,9 +40,9 @@ def buildOnLabel(label, buildCommand) {
stage("Install Dependencies (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh 'yarn install --frozen-lockfile'
sh 'yarn install --frozen-lockfile --production=false'
} else {
bat 'yarn install --frozen-lockfile'
bat 'yarn install --frozen-lockfile --production=false'
}
}
}
@ -51,10 +50,10 @@ def buildOnLabel(label, buildCommand) {
stage("Build (${label})") {
nodejs(nodeJSInstallationName: 'Node23') {
if (isUnix()) {
sh buildCommand
sh "NODE_ENV=production ${buildCommand}"
sh 'ls -la build || echo "Build directory not found"'
} else {
bat buildCommand
bat "set NODE_ENV=production && ${buildCommand}"
bat 'if not exist build echo "Build directory not found"'
}
}