This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
.drone.yml
230 lines (206 loc) · 5.13 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
kind: pipeline
type: docker
name: deployement-local
volumes:
- name: repo
host:
path: /media/raid5/data/packages/repos/apt/botamusique/
steps:
- name: build-web
image: node:16
commands:
- (cd web && npm install && npm run build)
when:
event:
- push
- tag
- name: translate-html
image: python:3
commands:
- pip3 install jinja2
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir web/templates/
when:
event:
- push
- tag
- name: deploy-testing
image: debian
commands:
- apt-get -qq update && apt-get -qq install git > /dev/null
- sed -i 's/target_version = git/target_version = testing/' configuration.default.ini
- git fetch --tags
- version=$(git describe --tags)
- echo "current git commit is $version"
- echo $version > /mnt/botamusique/testing-version
- sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py
- rm -rf .git*
- rm -rf web
- mkdir /tmp/botamusique
- cp -r . /tmp/botamusique/
- tar -czf /mnt/botamusique/sources-testing.tar.gz -C /tmp botamusique
volumes:
- name: repo
path: /mnt/botamusique/
when:
branch:
- master
event:
- push
- name: deploy-stable
image: debian
commands:
- apt-get -qq update && apt-get -qq install jq curl git pandoc python3-requests > /dev/null
- sed -i 's/target_version = git/target_version = stable/' configuration.default.ini
- git fetch --tags
- version=$(git describe --abbrev=0 --tags)
- echo "version is $version"
- echo $version > /mnt/botamusique/version
- sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py
- curl --silent "https://api.github.com/repos/azlux/botamusique/releases/latest" | jq -r '.body' | pandoc --from gfm --to html - --output - > /mnt/botamusique/changelog
- rm -rf .git*
- rm -rf web
- mkdir /tmp/botamusique
- cp -r . /tmp/botamusique/
- tar -czf /mnt/botamusique/sources-stable.tar.gz -C /tmp botamusique
volumes:
- name: repo
path: /mnt/botamusique/
when:
event:
- tag
node:
location: local
trigger:
event:
exclude:
- cron
---
kind: pipeline
type: docker
name: deployement-docker
steps:
- name: build-web
image: node:16
commands:
- (cd web && npm install && npm run build)
when:
event:
- push
- tag
- name: translate-html
image: python:3
commands:
- pip3 install jinja2
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir web/templates/
when:
event:
- push
- tag
- name: config-testing
image: debian
commands:
- sed -i 's/target_version = git/target_version = testing/' configuration.default.ini
when:
branch:
- master
event:
- push
- name: docker-testing
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
repo: azlux/botamusique
platforms: linux/amd64,linux/arm64,linux/arm/v7
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: testing
when:
branch:
- master
event:
- push
- name: config-stable
image: debian
commands:
- sed -i 's/target_version = git/target_version = stable/' configuration.default.ini
when:
event:
- tag
- name: docker-stable
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
repo: azlux/botamusique
platforms: linux/amd64,linux/arm64,linux/arm/v7
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: latest
when:
event:
- tag
node:
location: external
trigger:
event:
exclude:
- cron
---
kind: pipeline
type: docker
name: translation-traduora
steps:
- name: fetch-translation
image: debian
environment:
TRADUORA_R_CLIENT:
from_secret: TRADUORA_R_CLIENT
TRADUORA_R_SECRET:
from_secret: TRADUORA_R_SECRET
GITHUB_API:
from_secret: GITHUB_API
commands:
- apt update && apt install -y git python3-requests hub
- PUSH=true SOURCE_DIR=$(pwd) ./scripts/commit_new_translation.sh
node:
location: external
trigger:
event:
- cron
cron:
- auto-fetch-lang
---
kind: pipeline
type: docker
name: translation-git
steps:
- name: push-translation
image: debian
environment:
TRADUORA_R_CLIENT:
from_secret: TRADUORA_R_CLIENT
TRADUORA_R_SECRET:
from_secret: TRADUORA_R_SECRET
TRADUORA_W_CLIENT:
from_secret: TRADUORA_W_CLIENT
TRADUORA_W_SECRET:
from_secret: TRADUORA_W_SECRET
GITHUB_API:
from_secret: GITHUB_API
commands:
- apt update && apt install -y git python3-requests hub
- SOURCE_DIR=$(pwd) ./scripts/update_translation_to_server.sh
when:
branch:
- master
event:
- push
node:
location: external
trigger:
event:
exclude:
- cron