-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.jsonnet
More file actions
156 lines (153 loc) · 3.96 KB
/
Copy path.drone.jsonnet
File metadata and controls
156 lines (153 loc) · 3.96 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
local name = 'files';
local version = '1.4.0-stable';
local go = '1.24.0';
local nginx = '1.24.0';
local python = '3.12-slim-bookworm';
local platform = '26.04.10';
local playwright = 'v1.59.1-jammy';
local store_publisher = 'stable-346';
local distros = ['bookworm', 'buster'];
local platform_image(distro, arch) =
'syncloud/platform-' + distro + '-' + arch + ':' + platform;
local build(arch, 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, arch),
commands: ['./nginx/test.sh'],
}
for distro in distros
] + [
{
name: 'filebrowser',
image: 'debian:bookworm-slim',
commands: [
'./filebrowser/build.sh ' + version,
],
},
] + [
{
name: 'filebrowser test ' + distro,
image: platform_image(distro, arch),
commands: ['./filebrowser/test.sh'],
}
for distro in distros
] + [
{
name: 'cli',
image: 'golang:' + go,
commands: [
'./cli/build.sh',
],
},
] + [
{
name: 'cli test ' + distro,
image: platform_image(distro, arch),
commands: ['./cli/test.sh'],
}
for distro in distros
] + [
{
name: 'package',
image: 'debian:bookworm-slim',
commands: [
'./package.sh ' + name + ' $DRONE_BUILD_NUMBER',
],
},
] + [
{
name: 'test ' + distro,
image: 'python:' + python,
commands: ['./test/ci-test.sh ' + distro + ' ' + arch],
}
for distro in distros
] + (if ui then [
{
name: 'test-ui-' + project,
image: 'mcr.microsoft.com/playwright:' + playwright,
commands: ['./web/e2e/ci-ui.sh ' + project],
}
for project in ['desktop']
] + [
{
name: 'test-upgrade',
image: 'python:' + python,
commands: ['./test/ci-upgrade.sh buster ' + arch],
},
{
name: 'test-ui-after-upgrade',
image: 'mcr.microsoft.com/playwright:' + playwright,
commands: ['PLAYWRIGHT_DOMAIN=buster.com ./web/e2e/ci-ui.sh desktop'],
},
] 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'],
event: ['push'],
},
},
],
trigger: {
event: ['push'],
},
services: [
{
name: name + '.' + distro + '.com',
image: platform_image(distro, arch),
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)