在 Gitlab 上为 Flutter Web 设置 CI

问题描述 投票:0回答:1

我正在尝试在 Gitlab 上为 Flutter Web 设置 CI。我的`. 但它不会构建网络应用程序。

cirrus.yml` 文件:

image: cirrusci/flutter:latest

variables:
before_script:
  - flutter channel beta
  - flutter upgrade
  - flutter config --enable-web
  - flutter pub get
pages:
  stage: deploy
  script:
    - flutter build web
    - cp -r build/web public
  artifacts:
    paths:
      - public
  only:
    - live

管道不会自动启动。当我手动运行它时,出现以下错误:

No stages / jobs for this pipeline.
Specify variable values to be used in this run. The values specified in CI/CD settings will be used by default.
flutter gitlab cirrus-ci
1个回答
0
投票

我想问题是,你在使用之前没有定义你的阶段

stage: deploy

所以我想这应该可以解决你的问题:

image: cirrusci/flutter:latest

stages: 
  - deploy

pages:
  stage: deploy
  script:
    - flutter channel beta
    - flutter upgrade
    - flutter config --enable-web
    - flutter pub get
    - flutter build web
    - cp -r build/web public
  artifacts:
    paths:
      - public
  only:
    - live
© www.soinside.com 2019 - 2024. All rights reserved.