This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.drone.yml
115 lines (111 loc) · 3.25 KB
/
.drone.yml
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
106
107
108
109
110
111
112
113
114
115
# Copyright 2018 - 2020 Christian Müller <dev@c-mueller.xyz>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
kind: pipeline
name: linux-amd64
platform:
arch: amd64
os: linux
workspace:
base: /go
path: src/github.com/c-mueller/ads
steps:
- name: test
image: golang
secrets:
- codecov_token
environment:
CODECOV_TOKEN:
from_secret: codecov_token
commands:
- go test -coverprofile=coverage.txt -covermode=atomic -v ./...
- curl -s https://codecov.io/bash | bash
- name: build
image: golang
commands:
- rm go.mod go.sum || true
- mkdir -p /go/src/github.com/coredns/coredns
- git clone https://github.com/coredns/coredns.git /go/src/github.com/coredns/coredns
- cd /go/src/github.com/coredns/coredns
- git checkout $(git describe --tags --abbrev=0)
- sed -i "s|loadbalance:loadbalance|ads:ads\\\\nloadbalance:loadbalance|g" plugin.cfg
- ln -s /go/src/github.com/c-mueller/ads/ /go/src/github.com/coredns/coredns/plugin/ads
- make
- ./coredns -plugins
- mkdir -p /go/src/github.com/c-mueller/ads/binaries
- mv coredns /go/src/github.com/c-mueller/ads/binaries/coredns-ads-linux-amd64
- name: build-coredns-win
image: golang
environment:
GOOS: windows
GOARCH: amd64
commands:
- cd /go/src/github.com/coredns/coredns
- make
- mv coredns /go/src/github.com/c-mueller/ads/binaries/coredns-win-amd64.exe
when:
event: tag
- name: build-coredns-darwin
image: golang
environment:
GOOS: darwin
GOARCH: amd64
commands:
- cd /go/src/github.com/coredns/coredns
- make
- mv coredns /go/src/github.com/c-mueller/ads/binaries/coredns-darwin
when:
event: tag
- name: build-coredns-arm
image: golang
environment:
GOOS: linux
GOARCH: arm
commands:
- cd /go/src/github.com/coredns/coredns
- make
- mv coredns /go/src/github.com/c-mueller/ads/binaries/coredns-ads-arm
when:
event: tag
- name: build-coredns-arm64
image: golang
environment:
GOOS: linux
GOARCH: arm
commands:
- cd /go/src/github.com/coredns/coredns
- make
- mv coredns /go/src/github.com/c-mueller/ads/binaries/coredns-ads-arm64
when:
event: tag
- name: compute-hashsums
image: ubuntu:18.04
environment:
GOOS: linux
GOARCH: arm
commands:
- cd /go/src/github.com/c-mueller/ads/binaries/
- sha512sum * | tee hashsums.txt
when:
event: tag
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: binaries/*
when:
event: tag
---
kind: signature
hmac: 18133e199d1805cb81c7f014786ddbb5ab3f44254f4f26f9d41bb12c5198e8d0