forked from go-swagger/go-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
146 lines (134 loc) · 3.78 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
clone:
path: github.com/go-swagger/go-swagger
matrix:
GO_VERSION:
- "1.7"
build:
integration:
image: golang:$$GO_VERSION
pull: true
environment:
GOCOVMODE: "atomic"
commands:
- go get -u github.com/axw/gocov/gocov
- go get -u gopkg.in/matm/v1/gocov-html
- go get -u github.com/cee-dub/go-junit-report
- ./hack/build-drone.sh
- mkdir -p dist
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -installsuffix netgo -o dist/swagger ./cmd/swagger
canary:
image: golang:$$GO_VERSION
pull: true
environment:
GOCOVMODE: "atomic"
commands:
- go get -u github.com/go-swagger/scan-repo-boundary/makeplans
- go install ./cmd/swagger
- ./hack/run-canary.sh
when:
event: pull_request
release:
image: golang:$$GO_VERSION
pull: true
commands:
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends ruby-dev rubygems rpm
- gem install --no-rdoc --no-ri fpm
- go get -u github.com/mitchellh/gox
- mkdir -p /drone/dist/binaries
- "gox -os=\"linux darwin windows\" -arch=\"amd64 386\" -output=\"/drone/dist/binaries/{{.Dir}}_{{.OS}}_{{.Arch}}\" ./cmd/swagger"
- "gox -os=\"linux\" -arch=\"arm64 arm\" -output=\"/drone/dist/binaries/{{.Dir}}_{{.OS}}_{{.Arch}}\" ./cmd/swagger"
- cd /drone/dist
- mkdir -p /drone/dist/linux/amd64/usr/bin
- cp /drone/dist/binaries/swagger_linux_amd64 /drone/dist/linux/amd64/usr/bin/swagger
- "fpm -t deb -s dir -C /drone/dist/linux/amd64 -v $${TAG=dev} -n swagger --license \"ASL 2.0\" -a x86_64 -m \"ivan@flanders.co.nz\" --url \"https://goswagger.io\" usr"
- "fpm -t rpm -s dir -C /drone/dist/linux/amd64 -v $${TAG=dev} -n swagger --license \"ASL 2.0\" -a x86_64 -m \"ivan@flanders.co.nz\" --url \"https://goswagger.io\" usr"
when:
event: tag
notify:
slack:
channel: bots
webhook_url: $$SLACK_URL
username: drone
publish:
coverage:
server: https://coverage.vmware.run
token: $$GITHUB_TOKEN
# threshold: 70
# must_increase: true
github_release:
api_key: $$GITHUB_TOKEN
files:
- /drone/dist/binaries/swagger_*
checksum: sha1
when:
event: tag
docker:
privileged: true
registry: quay.io
username: $$QUAY_USER
password: $$QUAY_PASS
email: $$QUAY_EMAIL
repo: goswagger/swagger
file: Dockerfile
storage_driver: overlay
tag:
- latest
- "$${TAG=dev}"
when:
event: tag
docker:
privileged: true
registry: quay.io
username: $$QUAY_USER
password: $$QUAY_PASS
email: $$QUAY_EMAIL
repo: goswagger/swagger
file: Dockerfile
storage_driver: overlay
tag:
- "$$BRANCH"
when:
branch: "!master"
docker:
privileged: true
registry: quay.io
username: $$QUAY_USER
password: $$QUAY_PASS
email: $$QUAY_EMAIL
repo: goswagger/swagger
file: Dockerfile
storage_driver: overlay
tag:
- dev
when:
branch: "master"
bintray:
username: $$BINTRAY_USERNAME
api_key: $$BINTRAY_TOKEN
branch: $$BRANCH
artifacts:
- file: ../../../../dist/swagger-$${TAG=dev}-1.x86_64.rpm
owner: go-swagger
type: rpm
repository: goswagger-rpm
package: swagger
version: $${TAG=dev}
target: swagger-$${TAG=dev}-1.x86_64.rpm
publish: true
override: true
- file: ../../../../dist/swagger_$${TAG=dev}_amd64.deb
owner: go-swagger
type: Debian
repository: goswagger-debian
package: swagger
version: $${TAG=dev}
target: swagger_$${TAG=dev}_amd64.deb
distr: ubuntu
component: main
arch:
- amd64
publish: true
override: true
when:
event: tag