【发布时间】:2020-08-18 09:41:40
【问题描述】:
当我使用以下代码创建 Jenkins Pipeline 时,它不会加载系统环境变量
请给我建议
pipeline {
agent any
environment {
PATH = "C:\\WINDOWS\\SYSTEM32"
}
stages {
stage('build'){
steps{
dir('app'){
bat label: '', script: 'flutter build apk --release'
}
}}
stage('DISTRIBUTE') {
steps {
appCenter apiToken: "APKKEY",
appName: 'sampleApp',
distributionGroups: 'Test',
notifyTesters: false,
ownerName: 'sample',
pathToApp: 'app\\build\\app\\outputs\\apk\\release\\app-release.apk',
releaseNotes: '$BUILD_NUMBER'
}
}
}
}
错误日志 **在耐久性级别运行:MAX_SURVIVABILITY [流水线] 流水线的开始 [管道] 节点 在 F:\Program Files\Jenkins\workspace\APK 中的 Jenkins 上运行 [管道] { [管道] withEnv [管道] { [管道]阶段 [管道] {(构建) [管道] 目录 在 F:\Program Files\Jenkins\workspace\APK\app 中运行 [管道] { [管道] 蝙蝠
F:\Program Files\Jenkins\workspace\APK\app>flutter build apk --release
'flutter' is not recognized as an internal or external command,
operable program or batch file.
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (DISTRIBUTE)
Stage "DISTRIBUTE" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE**
【问题讨论】:
标签: flutter jenkins jenkins-pipeline jenkins-plugins jenkins-cli