【问题标题】:Jenkins 'flutter' is not recognized as an internal or external command,Jenkins 'flutter' 不被识别为内部或外部命令,
【发布时间】: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


    【解决方案1】:

    您是否在 PATH 中添加了颤振?如果你不能在终端中运行 flutter,那很有可能 Jenkins 也不能。

    https://flutter.dev/docs/get-started/install/windows#update-your-path

    【讨论】:

      猜你喜欢
      • 2022-12-31
      • 1970-01-01
      • 2021-09-15
      • 2021-02-08
      • 1970-01-01
      • 2015-01-30
      • 2014-10-21
      • 2014-02-08
      • 2017-08-22
      相关资源
      最近更新 更多