-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
141 lines (135 loc) · 3.42 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
---
kind: pipeline
type: docker
name: test
trigger:
event:
- push
workspace:
path: /app
services:
- name: postgres
image: postgres:10
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
steps:
- name: Prepare Ruby
image: ruby:3.0.0-buster
environment:
APP_HOST: http://localhost
SECRET_KEY_BASE: abcdefghijklmnoprstw
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
DATABASE_CLEANER_ALLOW_PRODUCTION: true
RAILS_ENV: test
DETOX_DATABASE_URL: postgresql://postgres:postgres@postgres:5432/
commands:
- bundle install
- bin/rake db:drop db:create db:migrate db:seed translations:dump graphql:dump
- bin/rails zeitwerk:check
- bin/rspec .
- name: Prepare frontend
image: node:14.15.4-buster
commands:
- cd app/javascript/api
- yarn
- yarn graphql:codegen
- name: Styleguide check
image: node:14.15.4-buster
commands:
- cd app/javascript/styleguide
- yarn test
- name: Store test
image: node:14.15.4-buster
commands:
- cd app/javascript/store
- yarn test
# - name: Shared test
# image: node:14.15.4-buster
# commands:
# - cd app/javascript/shared
# - yarn test
- name: Api test
image: node:14.15.4-buster
commands:
- cd app/javascript/api
- yarn test
- name: Native/Web test
image: node:14.15.4-buster
commands:
- cd app/javascript/client
- yarn test
- name: notify
image: plugins/matrix
settings:
homeserver:
from_secret: MATRIX_HOST
roomid:
from_secret: MATRIX_ROOM
username:
from_secret: MATRIX_USERNAME
password:
from_secret: MATRIX_PASSWORD
---
kind: pipeline
type: docker
name: deploy
trigger:
event:
- promote
workspace:
path: "/detox" # http://plugins.drone.io/drone-plugins/drone-docker/
steps:
- name: Set build number
image: ruby:3.0.0-buster
commands:
- 'echo "Current build number: $DRONE_BUILD_NUMBER"'
- 'echo -n "latest,$DRONE_BUILD_NUMBER" > .tags'
- name: Translations and graphql schema
image: ruby:3.0.0-buster
commands:
- bundle install
- cp .env.sample .env
- bin/rake translations:dump graphql:dump
- name: Install node dependencies
image: node:14.15.4-buster
commands:
- cd app/javascript/api
- yarn
- yarn graphql:codegen
- name: Build Web
image: node:14.15.4-buster
commands:
- cd app/javascript/client
- yarn
- yarn web:build
- name: Build Android
image: macbury/android-react-native:android-28
environment:
DETOX_ANDROID_STOREPASS:
from_secret: DETOX_ANDROID_STOREPASS
commands:
- mkdir -p native/
- cd app/javascript/client/android
- ./gradlew assembleRelease
- mv app/build/outputs/apk/release/app-release.apk ../../../../native/detox.apk
- mv app/build/outputs/apk/release/output.json ../../../../native/android.json
- name: Build Images
image: plugins/docker
settings:
repo: macbury/detox
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
- name: notify
image: plugins/matrix
settings:
homeserver:
from_secret: MATRIX_HOST
roomid:
from_secret: MATRIX_ROOM
username:
from_secret: MATRIX_USERNAME
password:
from_secret: MATRIX_PASSWORD