This repository has been archived by the owner on Mar 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.drone.star
91 lines (87 loc) · 2.06 KB
/
.drone.star
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
config = {
'images': [
'eos-eosd',
'eos-eosxd',
'eos-fst',
'eos-mgm',
'eos-mq',
'eos-qdb',
],
'eos_version': '4.8.26',
'qdb_version': '0.4.2',
}
def main(ctx):
stages = []
for image in config['images']:
stages.append(docker(ctx, image, []))
return stages
def docker(ctx, image, depends_on):
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'docker-%s' % (image),
'platform': {
'os': 'linux',
'arch': 'amd64',
},
'steps': [
{
'name': 'dryrun',
'image': 'plugins/docker:18.09',
'pull': 'always',
'settings': {
'dry_run': True,
'context': '%s' % (image),
'dockerfile': '%s/Dockerfile' % (image),
'repo': 'owncloud/%s' % (image),
'build_args': [
'EOS_VERSION=%s' % (config['eos_version']),
'QDB_VERSION=%s' % (config['qdb_version']),
],
},
'when': {
'ref': {
'include': [
'refs/pull/**',
],
},
},
},
{
'name': 'docker',
'image': 'plugins/docker:18.09',
'pull': 'always',
'settings': {
'username': {
'from_secret': 'public_username',
},
'password': {
'from_secret': 'public_password',
},
'auto_tag': True,
'context': '%s' % (image),
'dockerfile': '%s/Dockerfile' % (image),
'repo': 'owncloud/%s' % (image),
'build_args': [
'EOS_VERSION=%s' % (ctx.build.ref.replace("refs/tags/v", "") if ctx.build.event == 'tag' else config['eos_version']),
'QDB_VERSION=%s' % (config['qdb_version']),
],
},
'when': {
'ref': {
'exclude': [
'refs/pull/**',
],
},
},
},
],
'depends_on': depends_on,
'trigger': {
'ref': [
'refs/heads/master',
'refs/tags/v*',
'refs/pull/**',
],
},
}