提交jenkins自动化流水线

This commit is contained in:
Home
2026-03-29 03:18:50 +08:00
parent 88ba24034e
commit 1fc4327b25
Vendored
+18 -16
View File
@@ -36,24 +36,26 @@ pipeline {
sh "npm install --force --unsafe-perm --ignore-platform"
}
}
steps {
script {
VERSION_NAME = sh(
script: '''
node -p "require('json5').parse(require('fs').readFileSync('./src/manifest.json','utf8')).versionName"
''',
returnStdout: true
).trim()
stage('读取 manifest 版本号(json5 终极版)') {
steps {
script {
VERSION_NAME = sh(
script: '''
node -p "require('json5').parse(require('fs').readFileSync('./src/manifest.json','utf8')).versionName"
''',
returnStdout: true
).trim()
VERSION_CODE = sh(
script: '''
node -p "require('json5').parse(require('fs').readFileSync('./src/manifest.json','utf8')).versionCode"
''',
returnStdout: true
).trim()
VERSION_CODE = sh(
script: '''
node -p "require('json5').parse(require('fs').readFileSync('./src/manifest.json','utf8')).versionCode"
''',
returnStdout: true
).trim()
echo "版本名称:${VERSION_NAME}"
echo "版本号:${VERSION_CODE}"
echo "版本名称:${VERSION_NAME}"
echo "版本号:${VERSION_CODE}"
}
}
}
stage('打包uniapp') {