This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
forked from imranismail/drone-runner-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.star
105 lines (93 loc) · 1.98 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# go version
go = "golang:1.13"
# docker repository
repo = "drone/drone-runner-docker"
def main(ctx):
return [
pipeline_linux(),
pipeline_windows("1903"),
pipeline_windows("1809"),
pipeline_manifest(),
# manifest
]
def pipeline_linux():
return {
"kind": "pipeline",
"type": "docker",
"name": "linux",
"steps": [
test,
build,
publish("arm"),
publish("arm64"),
publish("amd64"),
]
}
def pipeline_windows(version):
return {
"kind": "pipeline",
"type": "ssh",
"name": "windows_%s" % version,
"server": {
},
"platform": {
"os": "windows",
},
"steps": [
"sh scripts/ci_%s.ps1" % version,
],
}
def pipeline_manifest():
return [
"kind": "pipeline",
"type": "docker",
"name": "linux",
"steps": [
{
}
]
]
# publish creates a docker publish step.
def publish(arch):
return {
"name": "publish_%s" % arch,
"image": "plugins/docker",
"pull": "if-not-exists",
"settings": {
"auto_tag": "true",
"auto_tag_suffix": "linux-%s" % arch,
"dockerfile": "docker/Dockerfile.linux.%s" % arch,
"repo": repo,
},
"when": {
"event": [ "push", "tag" ]
}
}
# test defines a test step that downloads
# dependencies and tests the packages.
test = {
"name": "test",
"image": go,
"volumes": mounts,
"commands": [
"go test -v ./...",
],
}
# build defines a build step that compiles
# the binaries.
build = {
"name": "build",
"image": go,
"volumes": mounts,
"commands": [
"sh scripts/build.sh",
],
"when": {
"event": [ "push", "tag" ]
}
}
# mount points shared by all steps.
mounts = [{
"name": "go",
"path": "/go",
}]