Browse Source

build: use GOPROXY and disable download on some steps (#7745)

* build: use GOPROXY

* disable download vendor on some steps
tags/v1.10.0-rc1
Antoine GIRARD 4 years ago
parent
commit
cd238bc415
2 changed files with 26 additions and 0 deletions
  1. 23
    0
      .drone.yml
  2. 3
    0
      Dockerfile

+ 23
- 0
.drone.yml View File

image: golang:1.11 # this step is kept as the lowest version of golang that we support image: golang:1.11 # this step is kept as the lowest version of golang that we support
environment: environment:
GO111MODULE: on GO111MODULE: on
GOPROXY: off
commands: commands:
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag - go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag


image: golang:1.12 image: golang:1.12
environment: environment:
GO111MODULE: on GO111MODULE: on
GOPROXY: off
GOOS: linux GOOS: linux
GOARCH: 386 GOARCH: 386
commands: commands:
- make test-vendor - make test-vendor
- make build - make build
environment: environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
TAGS: bindata sqlite sqlite_unlock_notify TAGS: bindata sqlite sqlite_unlock_notify


- name: unit-test - name: unit-test
commands: commands:
- make unit-test-coverage - make unit-test-coverage
environment: environment:
GOPROXY: off
TAGS: bindata sqlite sqlite_unlock_notify TAGS: bindata sqlite sqlite_unlock_notify
depends_on: depends_on:
- build - build
commands: commands:
- make test - make test
environment: environment:
GOPROXY: off
TAGS: bindata sqlite sqlite_unlock_notify TAGS: bindata sqlite sqlite_unlock_notify
depends_on: depends_on:
- build - build
commands: commands:
- make test - make test
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
depends_on: depends_on:
- tag-pre-condition - tag-pre-condition
- timeout -s ABRT 20m make test-sqlite-migration - timeout -s ABRT 20m make test-sqlite-migration
- timeout -s ABRT 20m make test-sqlite - timeout -s ABRT 20m make test-sqlite
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
depends_on: depends_on:
- build - build
- make test-mysql-migration - make test-mysql-migration
- make integration-test-coverage - make integration-test-coverage
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
TEST_LDAP: 1 TEST_LDAP: 1
depends_on: depends_on:
- timeout -s ABRT 20m make test-mysql-migration - timeout -s ABRT 20m make test-mysql-migration
- timeout -s ABRT 20m make test-mysql - timeout -s ABRT 20m make test-mysql
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
TEST_LDAP: 1 TEST_LDAP: 1
depends_on: depends_on:
- timeout -s ABRT 20m make test-mysql8-migration - timeout -s ABRT 20m make test-mysql8-migration
- timeout -s ABRT 20m make test-mysql8 - timeout -s ABRT 20m make test-mysql8
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
TEST_LDAP: 1 TEST_LDAP: 1
depends_on: depends_on:
- timeout -s ABRT 20m make test-pgsql-migration - timeout -s ABRT 20m make test-pgsql-migration
- timeout -s ABRT 20m make test-pgsql - timeout -s ABRT 20m make test-pgsql
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
TEST_LDAP: 1 TEST_LDAP: 1
depends_on: depends_on:
- make test-mssql-migration - make test-mssql-migration
- make test-mssql - make test-mssql
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
TEST_LDAP: 1 TEST_LDAP: 1
depends_on: depends_on:
commands: commands:
- make coverage - make coverage
environment: environment:
GOPROXY: off
TAGS: bindata TAGS: bindata
depends_on: depends_on:
- unit-test - unit-test
- make generate - make generate
- make release - make release
environment: environment:
GOPROXY: off
TAGS: bindata sqlite sqlite_unlock_notify TAGS: bindata sqlite sqlite_unlock_notify


- name: gpg-sign - name: gpg-sign
- make generate - make generate
- make release - make release
environment: environment:
GOPROXY: off
TAGS: bindata sqlite sqlite_unlock_notify TAGS: bindata sqlite sqlite_unlock_notify


- name: gpg-sign - name: gpg-sign
dry_run: true dry_run: true
repo: gitea/gitea repo: gitea/gitea
tags: linux-amd64 tags: linux-amd64
build_args:
- GOPROXY=off
when: when:
event: event:
- pull_request - pull_request
auto_tag: true auto_tag: true
auto_tag_suffix: linux-amd64 auto_tag_suffix: linux-amd64
repo: gitea/gitea repo: gitea/gitea
build_args:
- GOPROXY=off
password: password:
from_secret: docker_password from_secret: docker_password
username: username:
dry_run: true dry_run: true
repo: gitea/gitea repo: gitea/gitea
tags: linux-arm64 tags: linux-arm64
build_args:
- GOPROXY=off
when: when:
event: event:
- pull_request - pull_request
auto_tag: true auto_tag: true
auto_tag_suffix: linux-arm64 auto_tag_suffix: linux-arm64
repo: gitea/gitea repo: gitea/gitea
build_args:
- GOPROXY=off
password: password:
from_secret: docker_password from_secret: docker_password
username: username:

+ 3
- 0
Dockerfile View File

#Build stage #Build stage
FROM golang:1.12-alpine3.10 AS build-env FROM golang:1.12-alpine3.10 AS build-env


ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}

ARG GITEA_VERSION ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify" ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata $TAGS" ENV TAGS "bindata $TAGS"

Loading…
Cancel
Save