forked from syncloud/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
206 lines (182 loc) · 4.67 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
---
kind: pipeline
name: arm
platform:
os: linux
arch: arm
steps:
- name: version
image: syncloud/build-deps-arm
commands:
- "echo $(date +%y%m%d)$DRONE_BUILD_NUMBER > version"
- "echo platform > name"
- "echo build-arm-$DRONE_BRANCH > domain"
- name: build
image: syncloud/build-deps-arm
commands:
- NAME=$(cat name)
- VERSION=$(cat version)
- ./build.sh $NAME $VERSION
- name: test-unit
image: syncloud/build-deps-arm
commands:
- ./unit-test.sh
- name: test-js
image: syncloud/build-deps-arm
commands:
- export PATH=$(pwd)/node/bin:$PATH
- cd www/public
- npm run test
- name: test-intergation
image: syncloud/build-deps-arm
commands:
- pip2 install -r dev_requirements.txt
- APP_ARCHIVE_PATH=$(realpath $(cat package.name))
- DOMAIN=$(cat domain)
- NAME=$(cat name)
- cd integration
- py.test -x -s verify.py --domain=$DOMAIN --app-archive-path=$APP_ARCHIVE_PATH --device-host=device --app=$NAME
- name: upload
image: syncloud/build-deps-arm
commands:
- VERSION=$(cat version)
- NAME=$(cat name)
- PACKAGE=$(cat package.name)
- pip2 install -r dev_requirements.txt
- syncloud-upload.sh $NAME $DRONE_BRANCH $VERSION $PACKAGE
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
- name: ci-artifact
image: syncloud/build-deps-arm
commands:
- NAME=$(cat name)
- PACKAGE=$(cat package.name)
- pip2 install -r dev_requirements.txt
- syncloud-upload-artifact.sh $NAME integration/log $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
- syncloud-upload-artifact.sh $NAME integration/screenshot $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
- syncloud-upload-artifact.sh $NAME $PACKAGE $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
environment:
ARTIFACT_SSH_KEY:
from_secret: ARTIFACT_SSH_KEY
when:
status:
- failure
- success
services:
- name: device
image: syncloud/systemd-arm
privileged: true
volumes:
- name: dbus
path: /var/run/dbus
- name: dev
path: /dev
volumes:
- name: dbus
host:
path: /var/run/dbus
- name: dev
host:
path: /dev
- name: shm
temp: {}
---
kind: pipeline
name: amd64
platform:
os: linux
arch: amd64
steps:
- name: version
image: syncloud/build-deps-amd64
commands:
- "echo $(date +%y%m%d)$DRONE_BUILD_NUMBER > version"
- "echo platform > name"
- "echo build-amd64-$DRONE_BRANCH > domain"
- name: build
image: syncloud/build-deps-amd64
commands:
- NAME=$(cat name)
- VERSION=$(cat version)
- ./build.sh $NAME $VERSION
- name: test-unit
image: syncloud/build-deps-amd64
commands:
- ./unit-test.sh
- name: test-js
image: syncloud/build-deps-amd64
commands:
- export PATH=$(pwd)/node/bin:$PATH
- cd www/public
- npm run test
- name: test-intergation
image: syncloud/build-deps-amd64
commands:
- pip2 install -r dev_requirements.txt
- APP_ARCHIVE_PATH=$(realpath $(cat package.name))
- DOMAIN=$(cat domain)
- NAME=$(cat name)
- cd integration
- py.test -x -s verify.py --domain=$DOMAIN --app-archive-path=$APP_ARCHIVE_PATH --device-host=device --app=$NAME
- name: test-ui
image: syncloud/build-deps-amd64
commands:
- pip2 install -r dev_requirements.txt
- DOMAIN=$(cat domain)
- NAME=$(cat name)
- cd integration
- "xvfb-run -l --server-args='-screen 0, 1024x4096x24' py.test -x -s test-ui.py --domain=$DOMAIN --device-host=device --app=$NAME"
volumes:
- name: shm
path: /dev/shm
- name: upload
image: syncloud/build-deps-amd64
commands:
- VERSION=$(cat version)
- NAME=$(cat name)
- PACKAGE=$(cat package.name)
- pip2 install -r dev_requirements.txt
- syncloud-upload.sh $NAME $DRONE_BRANCH $VERSION $PACKAGE
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
- name: ci-artifact
image: syncloud/build-deps-amd64
commands:
- NAME=$(cat name)
- PACKAGE=$(cat package.name)
- pip2 install -r dev_requirements.txt
- syncloud-upload-artifact.sh $NAME integration/log $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
- syncloud-upload-artifact.sh $NAME integration/screenshot $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
- syncloud-upload-artifact.sh $NAME $PACKAGE $DRONE_BUILD_NUMBER-$(dpkg --print-architecture)
environment:
ARTIFACT_SSH_KEY:
from_secret: ARTIFACT_SSH_KEY
when:
status:
- failure
- success
services:
- name: device
image: syncloud/systemd-amd64
privileged: true
volumes:
- name: dbus
path: /var/run/dbus
- name: dev
path: /dev
volumes:
- name: dbus
host:
path: /var/run/dbus
- name: dev
host:
path: /dev
- name: shm
temp: {}
...