-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.jsonnet
More file actions
184 lines (181 loc) · 4.44 KB
/
Copy path.drone.jsonnet
File metadata and controls
184 lines (181 loc) · 4.44 KB
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
local name = 'ntfy';
local nginx = '1.24.0';
local node = '22-bookworm';
local golang = '1.25.14';
local python = '3.12-slim-bookworm';
local playwright = 'mcr.microsoft.com/playwright:v1.48.2-jammy';
local debian = 'bookworm-slim';
local platform = '26.08.01';
local store_publisher = 'stable-346';
local distro_default = 'bookworm';
local push_faker_host = 'push.mozaws.net';
local push_faker_port = '8090';
local push_faker_tls_port = '443';
local distros = ['bookworm', 'buster'];
local platform_image(distro) =
'syncloud/platform-' + distro + ':' + platform;
local build(arch, test_ui) = [{
kind: 'pipeline',
type: 'docker',
name: arch,
platform: {
os: 'linux',
arch: arch,
},
steps: [
{
name: 'nginx',
image: 'nginx:' + nginx,
commands: [
'./nginx/build.sh',
],
},
] + [
{
name: 'nginx test ' + distro,
image: platform_image(distro),
commands: [
'./nginx/test.sh',
],
}
for distro in distros
] + [
{
name: 'ntfy web',
image: 'node:' + node,
commands: [
'./ntfy/web.sh',
],
},
{
name: 'ntfy',
image: 'golang:' + golang,
commands: [
'./ntfy/build.sh $DRONE_BUILD_NUMBER',
],
},
] + [
{
name: 'ntfy test ' + distro,
image: platform_image(distro),
commands: [
'./ntfy/test.sh',
],
}
for distro in distros
] + [
{
name: 'cli',
image: 'golang:' + golang,
commands: [
'./cli/build.sh',
],
},
{
name: 'push faker',
image: 'golang:' + golang,
commands: [
'./push-faker/build.sh',
],
},
{
name: 'cli test',
image: 'golang:' + golang,
commands: [
'./cli/test.sh',
],
},
{
name: 'package',
image: 'debian:' + debian,
commands: [
'./package.sh ' + name + ' $DRONE_BUILD_NUMBER',
],
},
] + [
{
name: 'test ' + distro,
image: 'python:' + python,
commands: [
'./test/run.sh ' + distro + ' ' + name + ' $DRONE_BUILD_NUMBER',
],
}
for distro in distros
] + (if test_ui then [
{
name: push_faker_host,
image: 'debian:' + debian,
detach: true,
environment: {
PUSH_FAKER_HOST: push_faker_host,
PUSH_FAKER_PORT: push_faker_port,
PUSH_FAKER_TLS_PORT: push_faker_tls_port,
PUSH_FAKER_CERT_FILE: '/drone/src/push-faker/cert.pem',
},
commands: [
'./push-faker/faker',
],
},
{
name: 'e2e',
image: playwright,
commands: [
'./test/e2e/run.sh e2e ' + distro_default + '.com user Password1 root Password1 ' + push_faker_host + ':' + push_faker_port,
],
},
] else []) + [
{
name: 'publish',
image: 'syncloud/store-publisher:' + store_publisher,
environment: {
SYNCLOUD_TOKEN: { from_secret: 'SYNCLOUD_TOKEN' },
},
command: ['snap', '-c', '${DRONE_BRANCH}'],
when: {
branch: ['master', 'stable'],
event: ['push'],
},
},
{
name: 'artifact',
image: 'appleboy/drone-scp:1.6.4',
settings: {
host: { from_secret: 'artifact_host' },
username: 'artifact',
key: { from_secret: 'artifact_key' },
timeout: '2m',
command_timeout: '2m',
target: '/home/artifact/repo/' + name + '/${DRONE_BUILD_NUMBER}-' + arch,
source: ['artifact/*'],
strip_components: 1,
},
when: {
status: ['failure', 'success'],
},
},
],
trigger: {
event: ['push'],
},
services: [
{
name: name + '.' + distro + '.com',
image: platform_image(distro),
privileged: true,
entrypoint: ['/bin/sh', '-c',
"mkdir -p /etc/systemd/system/snapd.service.d && printf '[Service]\\nExecStartPost=/bin/sh -c \"/usr/bin/snap set system refresh.hold=2099-01-01T00:00:00Z\"\\n' > /etc/systemd/system/snapd.service.d/disable-refresh.conf && exec /sbin/init"],
volumes: [
{ name: 'dbus', path: '/var/run/dbus' },
{ name: 'dev', path: '/dev' },
],
}
for distro in distros
],
volumes: [
{ name: 'dbus', host: { path: '/var/run/dbus' } },
{ name: 'dev', host: { path: '/dev' } },
],
}];
build('amd64', true) +
build('arm64', false) +
build('arm', false)