Skip to content

Commit 975fd8c

Browse files
authored
Merge pull request #14 from drone-plugins/upgrade-drone
Upgrade and switch to Drone 1.0.0
2 parents e30fdc2 + e8e2287 commit 975fd8c

13 files changed

+632
-224
lines changed

.appveyor.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.drone.jsonnet

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
local PipelineTesting = {
2+
kind: "pipeline",
3+
name: "testing",
4+
platform: {
5+
os: "linux",
6+
arch: "amd64",
7+
},
8+
steps: [
9+
{
10+
name: "vet",
11+
image: "golang:1.11",
12+
pull: "always",
13+
environment: {
14+
GO111MODULE: "on",
15+
},
16+
commands: [
17+
"go vet ./...",
18+
],
19+
},
20+
{
21+
name: "test",
22+
image: "golang:1.11",
23+
pull: "always",
24+
environment: {
25+
GO111MODULE: "on",
26+
},
27+
commands: [
28+
"go test -cover ./...",
29+
],
30+
},
31+
],
32+
trigger: {
33+
branch: [ "master" ],
34+
},
35+
};
36+
37+
local PipelineBuild(os="linux", arch="amd64") = {
38+
kind: "pipeline",
39+
name: os + "-" + arch,
40+
platform: {
41+
os: os,
42+
arch: arch,
43+
},
44+
steps: [
45+
{
46+
name: "build-push",
47+
image: "golang:1.11",
48+
pull: "always",
49+
environment: {
50+
CGO_ENABLED: "0",
51+
GO111MODULE: "on",
52+
},
53+
commands: [
54+
"go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/drone-matrix",
55+
],
56+
when: {
57+
event: [ "push", "pull_request" ],
58+
},
59+
},
60+
{
61+
name: "build-tag",
62+
image: "golang:1.11",
63+
pull: "always",
64+
environment: {
65+
CGO_ENABLED: "0",
66+
GO111MODULE: "on",
67+
},
68+
commands: [
69+
"go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/drone-matrix",
70+
],
71+
when: {
72+
event: [ "tag" ],
73+
},
74+
},
75+
{
76+
name: "executable",
77+
image: "golang:1.11",
78+
pull: "always",
79+
commands: [
80+
"./release/" + os + "/" + arch + "/drone-matrix --help",
81+
],
82+
},
83+
{
84+
name: "dryrun",
85+
image: "plugins/docker:" + os + "-" + arch,
86+
pull: "always",
87+
settings: {
88+
dry_run: true,
89+
tags: os + "-" + arch,
90+
dockerfile: "docker/Dockerfile." + os + "." + arch,
91+
repo: "plugins/matrix",
92+
username: { "from_secret": "docker_username" },
93+
password: { "from_secret": "docker_password" },
94+
},
95+
when: {
96+
event: [ "pull_request" ],
97+
},
98+
},
99+
{
100+
name: "publish",
101+
image: "plugins/docker:" + os + "-" + arch,
102+
pull: "always",
103+
settings: {
104+
auto_tag: true,
105+
auto_tag_suffix: os + "-" + arch,
106+
dockerfile: "docker/Dockerfile." + os + "." + arch,
107+
repo: "plugins/matrix",
108+
username: { "from_secret": "docker_username" },
109+
password: { "from_secret": "docker_password" },
110+
},
111+
when: {
112+
event: [ "push", "tag" ],
113+
},
114+
},
115+
],
116+
depends_on: [
117+
"testing",
118+
],
119+
trigger: {
120+
branch: [ "master" ],
121+
},
122+
};
123+
124+
local PipelineNotifications = {
125+
kind: "pipeline",
126+
name: "notifications",
127+
platform: {
128+
os: "linux",
129+
arch: "amd64",
130+
},
131+
steps: [
132+
{
133+
name: "manifest",
134+
image: "plugins/manifest:1",
135+
pull: "always",
136+
settings: {
137+
username: { "from_secret": "docker_username" },
138+
password: { "from_secret": "docker_password" },
139+
spec: "docker/manifest.tmpl",
140+
ignore_missing: true,
141+
},
142+
},
143+
{
144+
name: "microbadger",
145+
image: "plugins/webhook:1",
146+
pull: "always",
147+
settings: {
148+
url: { "from_secret": "microbadger_url" },
149+
},
150+
},
151+
],
152+
depends_on: [
153+
"linux-amd64",
154+
"linux-arm64",
155+
"linux-arm",
156+
],
157+
trigger: {
158+
branch: [ "master" ],
159+
event: [ "push", "tag" ],
160+
},
161+
};
162+
163+
[
164+
PipelineTesting,
165+
PipelineBuild("linux", "amd64"),
166+
PipelineBuild("linux", "arm64"),
167+
PipelineBuild("linux", "arm"),
168+
PipelineNotifications,
169+
]

.drone.windows.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
kind: pipeline
3+
name: windows-amd64
4+
5+
platform:
6+
os: windows
7+
arch: amd64
8+
9+
steps:
10+
- name: build-push
11+
pull: always
12+
image: golang:1.11
13+
commands:
14+
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-matrix"
15+
environment:
16+
CGO_ENABLED: 0
17+
GO111MODULE: on
18+
when:
19+
event:
20+
- push
21+
- pull_request
22+
23+
- name: build-tag
24+
pull: always
25+
image: golang:1.11
26+
commands:
27+
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-matrix"
28+
environment:
29+
CGO_ENABLED: 0
30+
GO111MODULE: on
31+
when:
32+
event:
33+
- tag
34+
35+
- name: executable
36+
pull: always
37+
image: golang:1.11
38+
commands:
39+
- ./release/windows/amd64/drone-matrix --help
40+
41+
- name: dryrun
42+
pull: always
43+
image: plugins/docker:windows-amd64
44+
settings:
45+
dockerfile: docker/Dockerfile.windows.amd64
46+
dry_run: true
47+
password:
48+
from_secret: docker_password
49+
repo: plugins/matrix
50+
tags: windows-amd64
51+
username:
52+
from_secret: docker_username
53+
when:
54+
event:
55+
- pull_request
56+
57+
- name: publish
58+
pull: always
59+
image: plugins/docker:windows-amd64
60+
settings:
61+
auto_tag: true
62+
auto_tag_suffix: windows-amd64
63+
dockerfile: docker/Dockerfile.windows.amd64
64+
password:
65+
from_secret: docker_password
66+
repo: plugins/matrix
67+
username:
68+
from_secret: docker_username
69+
when:
70+
event:
71+
- push
72+
- tag
73+
74+
trigger:
75+
branch:
76+
- master

0 commit comments

Comments
 (0)