Implement build name setting from package.json version in Jenkinsfile
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
This commit is contained in:
parent
9c69a45ba4
commit
3c5ad2a230
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -1,3 +1,5 @@
|
||||
import groovy.json.JsonSlurperClassic
|
||||
|
||||
def deploy() {
|
||||
node('ubuntu') {
|
||||
try {
|
||||
@ -84,7 +86,21 @@ def buildOnLabel(label, buildCommand) {
|
||||
}
|
||||
}
|
||||
|
||||
def setBuildNameFromPackageVersion() {
|
||||
node('ubuntu') {
|
||||
stage('Set Build Name') {
|
||||
checkout scm
|
||||
def packageJson = new JsonSlurperClassic().parseText(readFile('package.json'))
|
||||
def version = packageJson.version
|
||||
currentBuild.displayName = "${version}"
|
||||
echo "Build name set to package.json version: ${version}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
setBuildNameFromPackageVersion()
|
||||
|
||||
parallel(
|
||||
'Windows Build': buildOnLabel('windows', 'pnpm build:electron'),
|
||||
'MacOS Build': buildOnLabel('macos', 'pnpm build:electron'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user