Skip to content

Commit 75f4ffd

Browse files
committed
Migrate configs to drone 1.0.0 and drop appveyor
1 parent ea7b7f5 commit 75f4ffd

File tree

4 files changed

+511
-205
lines changed

4 files changed

+511
-205
lines changed

.appveyor.yml

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

.drone.jsonnet

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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",
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-gitea-release",
55+
],
56+
when: {
57+
event: [ "push", "pull_request" ],
58+
},
59+
},
60+
{
61+
name: "build",
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-gitea-release",
70+
],
71+
when: {
72+
event: [ "tag" ],
73+
},
74+
},
75+
{
76+
name: "dryrun",
77+
image: "plugins/docker:" + os + "-" + arch,
78+
pull: "always",
79+
settings: {
80+
dry_run: true,
81+
tags: os + "-" + arch,
82+
dockerfile: "docker/Dockerfile." + os + "." + arch,
83+
repo: "plugins/gitea-release",
84+
username: { "from_secret": "docker_username" },
85+
password: { "from_secret": "docker_password" },
86+
},
87+
when: {
88+
event: [ "pull_request" ],
89+
},
90+
},
91+
{
92+
name: "publish",
93+
image: "plugins/docker:" + os + "-" + arch,
94+
pull: "always",
95+
settings: {
96+
auto_tag: true,
97+
auto_tag_suffix: os + "-" + arch,
98+
dockerfile: "docker/Dockerfile." + os + "." + arch,
99+
repo: "plugins/gitea-release",
100+
username: { "from_secret": "docker_username" },
101+
password: { "from_secret": "docker_password" },
102+
},
103+
when: {
104+
event: [ "push", "tag" ],
105+
},
106+
},
107+
],
108+
depends_on: [
109+
"testing",
110+
],
111+
trigger: {
112+
branch: [ "master" ],
113+
},
114+
};
115+
116+
local PipelineNotifications = {
117+
kind: "pipeline",
118+
name: "notifications",
119+
platform: {
120+
os: "linux",
121+
arch: "amd64",
122+
},
123+
steps: [
124+
{
125+
name: "manifest",
126+
image: "plugins/manifest:1",
127+
pull: "always",
128+
settings: {
129+
username: { "from_secret": "docker_username" },
130+
password: { "from_secret": "docker_password" },
131+
spec: "docker/manifest.tmpl",
132+
ignore_missing: true,
133+
},
134+
},
135+
{
136+
name: "microbadger",
137+
image: "plugins/webhook:1",
138+
pull: "always",
139+
settings: {
140+
url: { "from_secret": "microbadger_url" },
141+
},
142+
},
143+
],
144+
depends_on: [
145+
"linux-amd64",
146+
"linux-arm64",
147+
"linux-arm",
148+
],
149+
trigger: {
150+
branch: [ "master" ],
151+
event: [ "push", "tag" ],
152+
},
153+
};
154+
155+
[
156+
PipelineTesting,
157+
PipelineBuild("linux", "amd64"),
158+
PipelineBuild("linux", "arm64"),
159+
PipelineBuild("linux", "arm"),
160+
PipelineNotifications,
161+
]

.drone.windows.yml

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

0 commit comments

Comments
 (0)