Skip to content

Commit cd238bc

Browse files
sapklafriks
authored andcommitted
build: use GOPROXY and disable download on some steps (#7745)
* build: use GOPROXY * disable download vendor on some steps
1 parent 5b902e2 commit cd238bc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.drone.yml

+23
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ steps:
6666
image: golang:1.11 # this step is kept as the lowest version of golang that we support
6767
environment:
6868
GO111MODULE: on
69+
GOPROXY: off
6970
commands:
7071
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
7172

@@ -74,6 +75,7 @@ steps:
7475
image: golang:1.12
7576
environment:
7677
GO111MODULE: on
78+
GOPROXY: off
7779
GOOS: linux
7880
GOARCH: 386
7981
commands:
@@ -92,6 +94,7 @@ steps:
9294
- make test-vendor
9395
- make build
9496
environment:
97+
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
9598
TAGS: bindata sqlite sqlite_unlock_notify
9699

97100
- name: unit-test
@@ -100,6 +103,7 @@ steps:
100103
commands:
101104
- make unit-test-coverage
102105
environment:
106+
GOPROXY: off
103107
TAGS: bindata sqlite sqlite_unlock_notify
104108
depends_on:
105109
- build
@@ -116,6 +120,7 @@ steps:
116120
commands:
117121
- make test
118122
environment:
123+
GOPROXY: off
119124
TAGS: bindata sqlite sqlite_unlock_notify
120125
depends_on:
121126
- build
@@ -143,6 +148,7 @@ steps:
143148
commands:
144149
- make test
145150
environment:
151+
GOPROXY: off
146152
TAGS: bindata
147153
depends_on:
148154
- tag-pre-condition
@@ -159,6 +165,7 @@ steps:
159165
- timeout -s ABRT 20m make test-sqlite-migration
160166
- timeout -s ABRT 20m make test-sqlite
161167
environment:
168+
GOPROXY: off
162169
TAGS: bindata
163170
depends_on:
164171
- build
@@ -172,6 +179,7 @@ steps:
172179
- make test-mysql-migration
173180
- make integration-test-coverage
174181
environment:
182+
GOPROXY: off
175183
TAGS: bindata
176184
TEST_LDAP: 1
177185
depends_on:
@@ -192,6 +200,7 @@ steps:
192200
- timeout -s ABRT 20m make test-mysql-migration
193201
- timeout -s ABRT 20m make test-mysql
194202
environment:
203+
GOPROXY: off
195204
TAGS: bindata
196205
TEST_LDAP: 1
197206
depends_on:
@@ -209,6 +218,7 @@ steps:
209218
- timeout -s ABRT 20m make test-mysql8-migration
210219
- timeout -s ABRT 20m make test-mysql8
211220
environment:
221+
GOPROXY: off
212222
TAGS: bindata
213223
TEST_LDAP: 1
214224
depends_on:
@@ -223,6 +233,7 @@ steps:
223233
- timeout -s ABRT 20m make test-pgsql-migration
224234
- timeout -s ABRT 20m make test-pgsql
225235
environment:
236+
GOPROXY: off
226237
TAGS: bindata
227238
TEST_LDAP: 1
228239
depends_on:
@@ -237,6 +248,7 @@ steps:
237248
- make test-mssql-migration
238249
- make test-mssql
239250
environment:
251+
GOPROXY: off
240252
TAGS: bindata
241253
TEST_LDAP: 1
242254
depends_on:
@@ -248,6 +260,7 @@ steps:
248260
commands:
249261
- make coverage
250262
environment:
263+
GOPROXY: off
251264
TAGS: bindata
252265
depends_on:
253266
- unit-test
@@ -380,6 +393,7 @@ steps:
380393
- make generate
381394
- make release
382395
environment:
396+
GOPROXY: off
383397
TAGS: bindata sqlite sqlite_unlock_notify
384398

385399
- name: gpg-sign
@@ -481,6 +495,7 @@ steps:
481495
- make generate
482496
- make release
483497
environment:
498+
GOPROXY: off
484499
TAGS: bindata sqlite sqlite_unlock_notify
485500

486501
- name: gpg-sign
@@ -607,6 +622,8 @@ steps:
607622
dry_run: true
608623
repo: gitea/gitea
609624
tags: linux-amd64
625+
build_args:
626+
- GOPROXY=off
610627
when:
611628
event:
612629
- pull_request
@@ -618,6 +635,8 @@ steps:
618635
auto_tag: true
619636
auto_tag_suffix: linux-amd64
620637
repo: gitea/gitea
638+
build_args:
639+
- GOPROXY=off
621640
password:
622641
from_secret: docker_password
623642
username:
@@ -668,6 +687,8 @@ steps:
668687
dry_run: true
669688
repo: gitea/gitea
670689
tags: linux-arm64
690+
build_args:
691+
- GOPROXY=off
671692
when:
672693
event:
673694
- pull_request
@@ -679,6 +700,8 @@ steps:
679700
auto_tag: true
680701
auto_tag_suffix: linux-arm64
681702
repo: gitea/gitea
703+
build_args:
704+
- GOPROXY=off
682705
password:
683706
from_secret: docker_password
684707
username:

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#Build stage
44
FROM golang:1.12-alpine3.10 AS build-env
55

6+
ARG GOPROXY
7+
ENV GOPROXY ${GOPROXY:-direct}
8+
69
ARG GITEA_VERSION
710
ARG TAGS="sqlite sqlite_unlock_notify"
811
ENV TAGS "bindata $TAGS"

0 commit comments

Comments
 (0)