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 0
/
.drone.star
81 lines (78 loc) · 1.92 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
config = {
'eos_version': '4.8.26',
'xrd_version': '4.12.5',
}
def main(ctx):
stages = []
stages.append(docker(ctx, 'eos-base'))
return stages
def docker(ctx, image):
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': ctx.repo.slug,
'build_args': [
'EOS_VERSION=%s' % (config['eos_version']),
'XRD_VERSION=%s' % (config['xrd_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' % (ctx.repo.slug.replace("owncloud-docker/", "")),
'build_args': [
'EOS_VERSION=%s' % (ctx.build.ref.replace("refs/tags/v", "") if ctx.build.event == 'tag' else config['eos_version']),
'XRD_VERSION=%s' % (config['xrd_version']),
],
},
'when': {
'ref': {
'exclude': [
'refs/pull/**',
],
},
},
},
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/main',
'refs/tags/v*',
'refs/pull/**',
],
},
}