flutter_app/.drone.yml

235 lines
6.0 KiB
YAML
Raw Normal View History

2021-03-26 00:44:03 +00:00
---
kind: pipeline
type: docker
2021-04-13 20:23:18 +00:00
name: linux-android-test
2021-03-26 00:44:03 +00:00
2021-05-03 23:22:16 +00:00
clone:
disable: true
2021-03-26 00:44:03 +00:00
steps:
2021-05-03 23:22:16 +00:00
- name: clone
image: cirrusci/flutter:dev
2021-05-03 23:22:16 +00:00
environment:
2021-05-04 00:09:49 +00:00
buildbot_key_b64:
from_secret: buildbot_key_b64
2021-05-03 23:22:16 +00:00
commands:
- mkdir ~/.ssh
2021-05-04 00:09:49 +00:00
- echo buildbot_key_b64 > ~/.ssh/id_rsa.b64
2021-05-04 00:11:09 +00:00
- ls -lh ~/.ssh
- base64 -d ~/.ssh/id_rsa.b64 > ~/.ssh/id_rsa
# force by pass of ssh host key check, less secure
- ssh-keyscan -H build.openprivacy.ca >> ~/.ssh/known_hosts
2021-05-03 23:22:16 +00:00
- git clone gogs@git.openprivacy.ca:flutter/flutter_app.git .
- git checkout $DRONE_COMMIT
2021-03-26 00:44:03 +00:00
- name: fetch
2021-03-26 23:10:48 +00:00
image: cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
volumes:
- name: deps
path: /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands:
- wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/tor
- wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/torrc
- chmod a+x tor
- git fetch --tags
- echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
2021-03-27 00:02:13 +00:00
- flutter pub get
2021-03-27 01:00:43 +00:00
- mkdir deploy
2021-04-28 21:10:45 +00:00
- ./fetch-libcwtch-go.sh
2021-03-26 00:44:03 +00:00
#- name: quality
# image: golang
# volumes:
# - name: deps
# path: /go
# commands:
# - go list ./... | xargs go vet
# - go list ./... | xargs golint
# #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
- name: build-linux
image: openpriv/flutter-desktop:dev
2021-03-27 00:10:37 +00:00
volumes:
- name: deps
path: /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands:
2021-03-26 23:10:48 +00:00
- flutter build linux
2021-03-27 01:00:43 +00:00
- mkdir deploy/linux
- cp -r build/linux/x64/release/bundle/* deploy/linux
- cp /sdks/flutter/bin/cache/artifacts/engine/linux-x64/icudtl.dat deploy/linux
2021-03-26 00:44:03 +00:00
- name: build-android
2021-03-26 23:10:48 +00:00
image: cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
volumes:
- name: deps
path: /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands:
- flutter build appbundle
- flutter build apk
# or build apk --split-per-abi ?
2021-03-27 01:00:43 +00:00
- mkdir deploy/android
- cp build/app/outputs/bundle/release/app-release.aab deploy/android
- cp build/app/outputs/apk/release/app-release.apk deploy/android
2021-03-26 00:44:03 +00:00
2021-03-30 19:21:54 +00:00
- name: widget-tests
image: cirrusci/flutter:dev
volumes:
- name: deps
path: /root/.pub-cache
commands:
# - flutter config --enable-linux-desktop
2021-03-30 19:21:54 +00:00
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
2021-03-26 20:15:15 +00:00
# Todo: gonna need more work on container
# https://flutter.dev/desktop
# requirements: Visual Studio 2019 (not to be confused with Visual Studio Code) with the “Desktop development with C++” workload installed, including all of its default components
#- name: build-windows
2021-03-26 23:10:48 +00:00
# image: cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
#- volumes:
# - name: deps
# path: /root/.pub-cache
2021-03-26 20:15:15 +00:00
# commands:
# - flutter config --enable-windows-desktop
# - flutter build windows
2021-03-26 00:44:03 +00:00
- name: deploy-buildfiles
image: kroniak/ssh-client
environment:
BUILDFILES_KEY:
from_secret: buildfiles_key
secrets: [gogs_account_token]
when:
event: push
status: [ success ]
commands:
- echo $BUILDFILES_KEY > ~/id_rsab64
- base64 -d ~/id_rsab64 > ~/id_rsa
- chmod 400 ~/id_rsa
2021-03-27 01:00:43 +00:00
- export DIR=flwtch-`cat VERSION`-`cat BUILDDATE`
- mv deploy $DIR
2021-03-30 19:21:54 +00:00
- cp -r coverage/html $DIR/coverage-tests
2021-03-30 19:48:00 +00:00
- cp -r test/failures $DIR/test-failures || true
2021-03-26 00:44:03 +00:00
- cd $DIR
2021-03-27 01:00:43 +00:00
- find . -type f -exec sha256sum {} \; > ./../sha256s.txt
- mv ./../sha256s.txt .
2021-03-26 00:44:03 +00:00
- cd ..
# TODO: do deployment once files actaully compile
2021-03-27 01:00:43 +00:00
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
2021-03-26 00:44:03 +00:00
- name: notify-email
image: drillster/drone-email
2021-03-30 21:11:48 +00:00
settings:
host: build.openprivacy.ca
port: 25
skip_verify: true
from: drone@openprivacy.ca
2021-03-26 00:44:03 +00:00
when:
status: [ failure ]
- name: notify-gogs
image: openpriv/drone-gogs
when:
event: pull_request
status: [ success, changed, failure ]
2021-03-26 19:50:26 +00:00
environment:
GOGS_ACCOUNT_TOKEN:
from_secret: gogs_account_token
settings:
gogs_url: https://git.openprivacy.ca
2021-03-26 00:44:03 +00:00
2021-03-27 00:10:37 +00:00
volumes:
- name: deps
temp: {}
2021-03-26 00:44:03 +00:00
trigger:
2021-03-26 19:50:26 +00:00
repo: flutter/flutter_app
2021-03-26 00:44:03 +00:00
branch: trunk
event:
- push
- pull_request
2021-04-13 20:23:18 +00:00
2021-04-21 00:28:22 +00:00
---
kind: pipeline
type: docker
name: delay-windows
clone:
disable: true
2021-04-13 20:23:18 +00:00
2021-04-21 00:28:22 +00:00
steps:
- name: sleep
image: cirrusci/flutter:dev
commands:
- sleep 90
trigger:
repo: flutter/flutter_app
branch: trunk
event:
- push
2021-04-21 00:28:22 +00:00
2021-04-13 20:23:18 +00:00
---
kind: pipeline
type: docker
name: windows
platform:
os: windows
version: 1809
steps:
- name: fetch
2021-04-13 20:27:15 +00:00
image: openpriv/flutter-desktop:windows-dev
commands:
- git fetch --tags
- powershell -command "git describe --tags > VERSION"
2021-04-13 23:19:32 +00:00
- powershell -command "Get-Date -Format 'yyyy-MM-dd-HH-mm' >.\BUILDDATE"
2021-04-13 20:23:18 +00:00
- name: build-windows
2021-04-13 20:27:15 +00:00
image: openpriv/flutter-desktop:windows-dev
commands:
- flutter pub get
- flutter build windows
2021-04-20 22:07:37 +00:00
# flwtch-`cat VERSION`-`cat BUILDDATE`
- $Env:builddir = 'deploy\flwtch-win-'
- $Env:builddir += type .\VERSION
- $Env:builddir += '-'
2021-04-20 23:15:34 +00:00
- $Env:builddir += type .\BUILDDATE
2021-04-21 00:46:30 +00:00
- echo $Env:builddir
- dir
2021-04-21 01:00:13 +00:00
- dir build
- dir build\\windows
- dir build\\windows\\runner
- dir build\\windows\\runner\\Release
2021-04-14 00:13:00 +00:00
- mkdir deploy
2021-04-21 01:00:13 +00:00
- move build\\windows\\runner\\Release $Env:builddir
- dir
- dir deploy
2021-04-20 22:07:37 +00:00
- name: deploy-windows
2021-04-24 15:23:11 +00:00
#image: openpriv/flutter-desktop:windows-dev
image: openpriv/pscp:latest
2021-04-20 22:07:37 +00:00
when:
event: push
status: [ success ]
environment:
BUILDFILES_KEY:
from_secret: buildfiles_key_txt
commands:
- echo "hello"
- dir
- echo $Env:BUILDFILES_KEY > id_rsa
- dir
# TODO: make pscp load a profile with the server key accepted
#- C:\\bin\\pscp -P 22 -r -batch -i id_rsa deploy\\* buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
2021-04-13 20:23:18 +00:00
trigger:
repo: flutter/flutter_app
branch: trunk
event:
- push
2021-04-21 00:28:22 +00:00
depends_on:
- delay-windows