我正在尝试在 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.
我想问题是,你在使用之前没有定义你的阶段
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