-
Notifications
You must be signed in to change notification settings - Fork 4
/
.drone.yml
166 lines (155 loc) · 4.38 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
kind: pipeline
type: docker
name: Android app
steps:
- name: build app
image: ghcr.io/cirruslabs/flutter:stable
environment:
ANDROID_KEY_FILE: /tmp/key.properties
SERVER_URL:
from_secret: server_url
commands:
- cd src/main/app
- git submodule init
- git submodule update
- wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json
- wget http://$SERVER_URL/key.properties -O /tmp/key.properties
- wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks
# might need necessary if going f-droid someday
# - cd ..
# - cp -R app /tmp/build
# - cd /tmp/build
- export PUB_CACHE=$(pwd)/.pub-cache
- ./submodules/flutter/bin/flutter doctor
- ./submodules/flutter/bin/flutter config --no-analytics
- ./submodules/flutter/bin/flutter pub get
# - ./submodules/flutter/bin/flutter pub run flutter_native_splash:create
# - ./submodules/flutter/bin/flutter build apk --split-per-abi
# - ./submodules/flutter/bin/flutter build apk
- ./submodules/flutter/bin/flutter build appbundle
# - cd /drone/src/
# - cd src/main/app
# - mkdir -p build/app/outputs/flutter-apk
# - mkdir -p build/app/outputs/bundle/release
# - cp /tmp/build/build/app/outputs/flutter-apk/* build/app/outputs/flutter-apk/
# - cp /tmp/build/build/app/outputs/bundle/release/* build/app/outputs/bundle/release/
# - ls build/app/outputs/flutter-apk/
# - ls build/app/outputs/bundle/release/
- name: Release Android
image: ruby
environment:
JSON_KEY_FILE: /tmp/service-account.json
SERVER_URL:
from_secret: server_url
commands:
- cd src/main/app
- wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json
- wget http://$SERVER_URL/key.properties -O /tmp/key.properties
- wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks
- cd android
- gem install fastlane
- fastlane deploy
when:
event: tag
trigger:
event:
- push
- tag
---
kind: pipeline
type: docker
name: Backend & web
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./m2
- ./src/main/web/node_modules
- name: build web
image: cirrusci/flutter:stable
pull: always
commands:
- id
- cd src/main/app
- git submodule init
- git submodule update
- ./submodules/flutter/bin/flutter doctor
- ./submodules/flutter/bin/flutter pub get
- ./submodules/flutter/bin/flutter doctor
- ./submodules/flutter/bin/flutter build web --release
- cp -R build/web ../resources/public
## setting maven version if it's a new release
- name: set version
image: maven:3.8-openjdk-17
commands:
- mvn versions:set -DnewVersion=${DRONE_TAG} -Dmaven.repo.local=./m2
- mvn versions:commit -Dmaven.repo.local=./m2
when:
event: tag
- name: build backend
image: maven:3.8-openjdk-17
commands:
- mvn clean install -Dmaven.repo.local=./m2 -Dspring.main.allow-circular-references=true
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./m2
- ./src/main/web/node_modules
- name: publish new version
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- '${DRONE_COMMIT}'
- '${DRONE_TAG}'
- latest
repo: gonzague/spendspentspent
context: ./
dockerfile: docker/Dockerfile.lite
when:
event: tag
- name: publish commit
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- '${DRONE_COMMIT}'
repo: gonzague/spendspentspent
context: ./
dockerfile: docker/Dockerfile.lite
when:
event:
exclude:
- tag
- name: git hub release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: target/SpendSpentSpent-*.jar
when:
event: tag
trigger:
event:
- push
- tag
volumes:
- name: cache
host:
path: /home/core/cache