【问题标题】:Azure Pipeline flutter command in Command Line Script命令行脚本中的 Azure Pipeline flutter 命令
【发布时间】:2022-09-23 15:52:10
【问题描述】:

我正在尝试使用 Azure Dev Ops 构建和部署 Flutter Web App。 我使用 Flutter Install 和 Flutter Build 建立了一个管道。在构建应用程序之前,我想为一些配置运行命令行脚本。在脚本的最后,我想为代码生成器运行flutter pub run build_runner build。但是我需要配置flutter命令,不知道怎么配置。否则,输出为command not found: flutter

这是我的管道的屏幕截图:

起初我认为 Flutter Install 任务已经解决了这个问题。但事实并非如此。有人知道我需要配置什么才能运行颤振命令吗?

    标签: flutter azure cmd


    【解决方案1】:

    这是我将 Flutter Web 应用程序部署到 Azure 静态 Web 应用程序的方式:

    • here获取颤振任务
    • 使用此 yaml 文件进行部署以将 Flutter 应用部署到 Azure 静态 Web 应用中:
    • 不要忘记为静态 Web 应用令牌设置变量
    trigger:
      - http-request
    
    pool:
      vmImage: ubuntu-latest
    
    steps:
      - task: Hey24sheep.flutter.flutter-install.FlutterInstall@0
        displayName: 'Flutter Install'
      
      - task: Hey24sheep.flutter.flutter-command.FlutterCommand@0
        displayName: 'Flutter Command'
        inputs:
          projectDirectory: app
          arguments: 'config --enable-web'
    
    
      - task: Hey24sheep.flutter.flutter-command.FlutterCommand@0
        displayName: 'flutter run build web'
        inputs:
          projectDirectory: app #{here put your source code folder}
          arguments: 'build web'
    
      - task: AzureStaticWebApp@0
        displayName: "web"
        inputs:
          app_location: "app" #{here put your source code folder}
          api_location: ""
          # app_build_command: "flutter build web"
          app_build_command: ""
          output_location: "build/web"
        env:
          azure_static_web_apps_api_token: $(deployment-token-development)
    

    【讨论】:

      猜你喜欢
      • 2011-03-10
      • 1970-01-01
      • 2020-05-16
      • 2019-06-11
      • 1970-01-01
      • 2021-03-01
      • 2022-08-02
      • 1970-01-01
      • 2013-06-24
      相关资源
      最近更新 更多