forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
175 lines (162 loc) · 3.51 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
---
kind: pipeline
name: default
steps:
- name: download-dependencies
image: golang:1.13
commands:
# wait for services to be ready.
- sleep 5
- go mod download
- go mod vendor # this is for when the Dockerfile gets built
environment:
GO111MODULE: on
GOPROXY: http://athens-proxy:3000
volumes:
- name: cache
path: /go
- name: build
image: golang:1.13
commands:
# build
- go build cmd/proxy/*.go
# test
- ./scripts/check_gofmt.sh
- go vet ./...
- go test -v ./...
# end to end test
- ./main & # run the just-built athens server
- sleep 3 # wait for it to spin up
- mkdir -p ~/happy
- mkdir -p ~/emptygopath # ensure the gopath has no modules cached.
- cd ~/happy
- git clone https://github.com/athens-artifacts/happy-path.git
- cd happy-path
- GOPATH=~/emptygopath GOPROXY=http://localhost:3000 go build
environment:
GO111MODULE: on
ATHENS_MONGO_STORAGE_URL: mongodb://mongo:27017
ATHENS_MINIO_ENDPOINT: minio:9000
REDIS_TEST_ENDPOINT: redis:6379
GCS_SERVICE_ACCOUNT:
from_secret: GCS_SERVICE_ACCOUNT
GCS_PROJECT_ID:
from_secret: GOOGLE_CLOUD_PROJECT
ATHENS_AZURE_ACCOUNT_NAME:
from_secret: ATHENS_AZURE_ACCOUNT_NAME
ATHENS_AZURE_ACCOUNT_KEY:
from_secret: ATHENS_AZURE_ACCOUNT_KEY
when:
branch:
- master
event:
- push
- pull_request
volumes:
- name: cache
path: /go
- name: docker-latest
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: gomods/athens
tags:
- canary
dockerfile: cmd/proxy/Dockerfile
build_args:
- VERSION=${DRONE_COMMIT}
when:
branch:
- master
event:
- push
- name: docker-latest-commit-sha
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: gomods/athens-dev
tags:
- ${DRONE_COMMIT:0:7}
dockerfile: cmd/proxy/Dockerfile
build_args:
- VERSION=${DRONE_COMMIT}
when:
branch:
- master
event:
- push
- name: docker-release
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: gomods/athens
tags:
- ${DRONE_TAG}
- latest
dockerfile: cmd/proxy/Dockerfile
build_args:
- VERSION=${DRONE_TAG}
when:
event:
- tag
- name: publish-helm
image: gomods/drone-helm
settings:
charts_repo: https://athens.blob.core.windows.net
environment:
AZURE_STORAGE_CONNECTION_STRING:
from_secret: AZURE_STORAGE_CONNECTION_STRING
when:
branch:
- master
event:
- push
# Here we can add any backend storage that can be tested.
services:
- name: mongo
image: mongo
ports:
- 27017
- name: minio
image: minio/minio:latest
command:
- server
- /data
ports:
- 9000
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
- name: redis
image: redis
ports:
- 6379
- name: athens-proxy
image: gomods/athens:canary
pull: always
ports:
- 3000
environment:
ATHENS_GOGET_WORKERS: 5
ATHENS_PROTOCOL_WORKERS: 10
ATHENS_SINGLE_FLIGHT_TYPE: gcp
ATHENS_STORAGE_TYPE: gcp
ATHENS_STORAGE_GCP_BUCKET: "athens_ci_build"
ATHENS_STORAGE_GCP_JSON_KEY:
from_secret: GCS_SERVICE_ACCOUNT
volumes:
- name: cache
temp: {}
---
kind: signature
hmac: 8ee2a04fedfd1a0c1ab3da19a3441485bf447de3e04fe057f626c83454a042b6
...