Test Flutter on Drone CI

栏目: IT技术 · 发布时间: 6年前

内容简介:This post is specific toRecently I’ve been playing around with Flutter and Dart. As a backend engineer I have to say I quite like it. Dart is a breeze to work with, the static typing helps a lot. Flutter itself offers a react-like way of structuring your a

This post is specific to Drone CI , but is probably easily adoptable to other CI systems, like Gitlab.

Flutter is UI library based on Dart to create beautiful, natively compiled applications for mobile. Web and desktop targets are also in the works.

Recently I’ve been playing around with Flutter and Dart. As a backend engineer I have to say I quite like it. Dart is a breeze to work with, the static typing helps a lot. Flutter itself offers a react-like way of structuring your app, but it runs natively on Android and iOS. At Kabisa we’re in the process of adopting Flutter as our go-to solution for cross platform mobile apps.

Anyway, one of the first things I do is hook a new project up with my CI, currently Drone CI . I started looking for an already published docker image that contains the latest flutter-stable installation. I soon found cirruslabs/docker-images-flutter , but ran into an permission error. Turns out [I’m not the only one][cl-issues], but with a few simple steps you can test your flutter app with this image on Drone CI without issue.

.drone.yml :

kind: pipeline
name: default

steps:
- name: test
  image: cirrusci/flutter:stable
  commands:
    - sudo chown -R cirrus:cirrus .
    - flutter doctor
    - flutter test

The magic is the sudo chown -R cirrus:cirrus . . The flutter docker images are based on Cirrus Labs’ android SDK images, which runs commands as the cirrus user. This will change permissions and the flutter commands can now run without issue.

Any next steps in your pipeline will encounter files owned by cirrus . Since most drone plugins and images run as root anyway, this is not much of and issue. You could add another command to the snippet above to reset permissions back to root .

Note that I’m using cirrusci/flutter:stable . They’ve also got images available for beta and dev , just use the appropriate tag.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

引爆点

引爆点

【加】马尔科姆•格拉德威尔(Malcolm Gladwell) / 钱清、覃爱冬 / 中信出版社 / 2014-4 / 36.00元

《引爆点》是《纽约客》怪才格拉德威尔的一部才华横溢之作。他以社会上突如其来的流行潮为切入点,从全新角度探索了控制科学和营销模式。他认为,思想、行为、信息及产品常会像传染病暴发一样迅速传播。正如一个病人就能引起全城流感;几位涂鸦爱好者能在地铁掀起犯罪浪潮;一位满意而归的顾客还能让新开张的餐馆座无虚席;发起小规模流行的团队能引发大规模流行风暴。这些现象均属“社会流行潮”,它达到临界水平并爆发的那一刻,......一起来看看 《引爆点》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具