-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
136 lines (132 loc) · 4.18 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
pipeline:
check-diffs:
image: bravissimolabs/alpine-git
commands:
- cd /drone/src/github.com/vespakoen/dwaler
- git diff --name-only ${DRONE_PREV_COMMIT_SHA}..@
- git diff --exit-code --name-only ${DRONE_PREV_COMMIT_SHA}..@ -- libs/dwaler-client/ || echo "true" > lib-dwaler-client_changed
# - git diff --exit-code --name-only ${DRONE_PREV_COMMIT_SHA}..@ -- apps/desktop/ || echo "true" > app-desktop_changed
- git diff --exit-code --name-only ${DRONE_PREV_COMMIT_SHA}..@ -- apps/mobile/ || echo "true" > app-mobile_changed
- git diff --exit-code --name-only ${DRONE_PREV_COMMIT_SHA}..@ -- chips/nano/ || echo "true" > chip-nano_changed
# # DESKTOP APP
# # LOAD CACHE
# load-app-desktop-cache:
# image: plugins/sftp-cache:latest
# mount:
# - apps/desktop/node_modules
# restore: true
# when:
# event: [ pull_request, push ]
# # BUILD
# build-app-desktop:
# image: node:6
# environment:
# NPM_CONFIG_LOGLEVEL: "warn"
# NPM_CONFIG_COLOR: "always"
# commands:
# # - cat app-desktop_changed || exit 0
# - dpkg --add-architecture i386
# - wget https://dl.winehq.org/wine-builds/Release.key
# - apt-key add Release.key
# - apt-get update -y
# - apt-get install apt-transport-https
# - bash -c "echo 'deb https://dl.winehq.org/wine-builds/debian/ jessie main' >> /etc/apt/sources.list"
# - apt-get update -y
# - apt-get install -y wine-devel
# - cd apps/desktop
# - npm install
# - npm test
# - npm run build
# - npm run release
# # SAVE CACHE
# save-app-desktop-cache:
# image: plugins/sftp-cache:latest
# mount:
# - apps/desktop/node_modules
# rebuild: true
# when:
# event: [ push ]
# JS CLIENT LIB
# LOAD CACHE
load-lib-dwaler-client-cache:
image: plugins/sftp-cache:latest
mount:
- libs/dwaler-client/node_modules
restore: true
when:
event: [ pull_request, push ]
# BUILD
build-lib-dwaler-client:
image: node:6
environment:
NPM_CONFIG_LOGLEVEL: "warn"
NPM_CONFIG_COLOR: "always"
commands:
# - cat lib-dwaler-client_changed || exit 0
- cd libs/dwaler-client
- npm install
- npm test
- npm run build
# SAVE CACHE
save-lib-dwaler-client-cache:
image: plugins/sftp-cache:latest
mount:
- libs/dwaler-client/node_modules
rebuild: true
when:
event: [ push ]
# NANO CHIP
# BUILD
build-chip-nano:
image: ubuntu:xenial
commands:
- apt-get update -y
- apt-get install -y curl python
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
- cd chips/nano
- platformio ci --project-conf platformio.ini --lib "lib/*/" src
# MOBILE APP
# LOAD CACHE
load-app-mobile-cache:
image: plugins/sftp-cache:latest
mount:
- apps/mobile/node_modules
restore: true
when:
event: [ pull_request, push ]
# BUILD
build-app-mobile:
image: node:6
environment:
NPM_CONFIG_LOGLEVEL: "warn"
NPM_CONFIG_COLOR: "always"
commands:
# - cat app-mobile_changed || exit 0
- cd apps/mobile
- npm install
- npm test
- npm start &
- sleep 20
- curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
# COMPILE
compile-app-mobile-android:
image: beevelop/android:latest
commands:
- cd apps/mobile/android
- bash -c "(while [ 1 ]; do sleep 1; echo y; done) | android update sdk --no-ui --all --filter tool,platform,android-23,build-tools-23.0.1"
- ./gradlew assembleRelease
- keytool -genkey -v -keystore my-keystore.keystore -alias name_alias -keyalg RSA -validity 10000
# - jarsigner -verbose -keystore my-keystore.keystore <path of apk> alias_name
# - zipalign -f -v 4 <your.apk > <your_aligned.apk>
# SAVE CACHE
save-app-mobile-cache:
image: plugins/sftp-cache:latest
mount:
- apps/mobile/node_modules
rebuild: true
when:
event: [ push ]
# SLACK NOTIFICATIONS
notify:
image: plugins/slack:latest
channel: general