From 7819a84853ea4ab97c0ef216380db231e4c36770 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 05:39:54 +0100 Subject: [PATCH 01/20] ci: try re-ordering for optimizing time --- .drone.yml | 227 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 129 insertions(+), 98 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7a844af8eb43d..dc47f8dd5df00 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: testing +name: init platform: os: linux @@ -10,39 +10,6 @@ workspace: base: /go path: src/code.gitea.io/gitea -services: - - name: mysql - pull: default - image: mysql:5.7 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: test - - - name: mysql8 - pull: default - image: mysql:8.0 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea - - - name: pgsql - pull: default - image: postgres:9.5 - environment: - POSTGRES_DB: test - - - name: mssql - pull: default - image: microsoft/mssql-server-linux:latest - environment: - ACCEPT_EULA: Y - MSSQL_PID: Standard - SA_PASSWORD: MwantsaSecurePassword1 - - - name: ldap - pull: default - image: gitea/test-openldap:latest - steps: - name: fetch-tags pull: default @@ -54,6 +21,30 @@ steps: exclude: - pull_request + - name: tag-pre-condition + pull: always + image: alpine/git + commands: + - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} + when: + event: + - tag +--- +kind: pipeline +name: build + +platform: + os: linux + arch: amd64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +depends_on: + - init + +steps: - name: pre-build pull: always image: node:10 # this step is kept at the lowest version of node that we support @@ -83,7 +74,7 @@ steps: - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit - - name: build + - name: generate-build pull: always image: golang:1.13 commands: @@ -100,6 +91,55 @@ steps: GOSUMDB: sum.golang.org TAGS: bindata sqlite sqlite_unlock_notify +--- +kind: pipeline +name: testing + +platform: + os: linux + arch: amd64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +depends_on: + - init + +services: + - name: mysql + pull: default + image: mysql:5.7 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: test + + - name: mysql8 + pull: default + image: mysql:8.0 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + + - name: pgsql + pull: default + image: postgres:9.5 + environment: + POSTGRES_DB: test + + - name: mssql + pull: default + image: microsoft/mssql-server-linux:latest + environment: + ACCEPT_EULA: Y + MSSQL_PID: Standard + SA_PASSWORD: MwantsaSecurePassword1 + + - name: ldap + pull: default + image: gitea/test-openldap:latest + +steps: - name: unit-test pull: always image: golang:1.13 @@ -108,8 +148,6 @@ steps: environment: GOPROXY: off TAGS: bindata sqlite sqlite_unlock_notify - depends_on: - - build when: branch: - master @@ -125,8 +163,6 @@ steps: environment: GOPROXY: off TAGS: bindata sqlite sqlite_unlock_notify - depends_on: - - build when: branch: - "release/*" @@ -134,17 +170,6 @@ steps: - push - pull_request - - name: tag-pre-condition - pull: always - image: alpine/git - commands: - - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} - depends_on: - - build - when: - event: - - tag - - name: tag-test pull: always image: golang:1.13 @@ -153,8 +178,6 @@ steps: environment: GOPROXY: off TAGS: bindata - depends_on: - - tag-pre-condition when: event: - tag @@ -170,8 +193,6 @@ steps: environment: GOPROXY: off TAGS: bindata - depends_on: - - build - name: test-mysql pull: always @@ -185,8 +206,6 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 - depends_on: - - build when: branch: - master @@ -206,8 +225,6 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 - depends_on: - - build when: event: - tag @@ -224,8 +241,6 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 - depends_on: - - build - name: test-pgsql pull: always @@ -239,8 +254,6 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 - depends_on: - - build - name: test-mssql pull: always @@ -254,8 +267,6 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 - depends_on: - - build - name: generate-coverage pull: always @@ -292,7 +303,7 @@ steps: event: - push - pull_request - + --- kind: pipeline name: translations @@ -311,6 +322,9 @@ trigger: event: - push +depends_on: + - init + steps: - name: download pull: always @@ -476,7 +490,7 @@ trigger: - tag depends_on: - - testing + - build steps: - name: fetch-tags @@ -578,7 +592,7 @@ steps: --- kind: pipeline -name: docker-linux-amd64 +name: docker-linux-amd64-dry-run platform: os: linux @@ -589,25 +603,13 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - testing + - build trigger: ref: - - refs/heads/master - - "refs/tags/**" - "refs/pull/**" steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - name: dryrun pull: always image: plugins/docker:linux-amd64 @@ -621,6 +623,27 @@ steps: event: - pull_request +--- +kind: pipeline +name: docker-linux-amd64-release + +platform: + os: linux + arch: amd64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +depends_on: + - testing + +trigger: + ref: + - refs/heads/master + - "refs/tags/**" + +steps: - name: publish pull: always image: plugins/docker:linux-amd64 @@ -641,7 +664,7 @@ steps: --- kind: pipeline -name: docker-linux-arm64 +name: docker-linux-arm64-dry-run platform: os: linux @@ -652,25 +675,13 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - testing + - build trigger: ref: - - refs/heads/master - - "refs/tags/**" - "refs/pull/**" steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - name: dryrun pull: always image: plugins/docker:linux-arm64 @@ -684,6 +695,26 @@ steps: event: - pull_request +--- +kind: pipeline +name: docker-linux-arm64-release + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +depends_on: + - testing + +trigger: + ref: + - refs/heads/master + - "refs/tags/**" + - name: publish pull: always image: plugins/docker:linux-arm64 @@ -729,8 +760,8 @@ trigger: - "refs/tags/**" depends_on: - - docker-linux-amd64 - - docker-linux-arm64 + - docker-linux-amd64-release + - docker-linux-arm64-release --- kind: pipeline @@ -757,8 +788,8 @@ depends_on: - translations - release-version - release-master - - docker-linux-amd64 - - docker-linux-arm64 + - docker-linux-amd64-release + - docker-linux-arm64-release - docker-manifest - docs From e1fa574699ef98877cf7529b1659d11583143027 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 05:44:19 +0100 Subject: [PATCH 02/20] ci: try re-ordering for optimizing time --- .drone.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index dc47f8dd5df00..f8a737e90f673 100644 --- a/.drone.yml +++ b/.drone.yml @@ -396,12 +396,6 @@ depends_on: - translations steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - - name: static pull: always image: techknowlogick/xgo:latest @@ -490,15 +484,9 @@ trigger: - tag depends_on: - - build + - testing steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - - name: static pull: always image: techknowlogick/xgo:latest From dff29f12c849b6824235a56e5feb082f380aa49c Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 05:56:12 +0100 Subject: [PATCH 03/20] ci: try re-ordering for optimizing time --- .drone.yml | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.drone.yml b/.drone.yml index f8a737e90f673..ae57d2a20b619 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: init +name: compatibility platform: os: linux @@ -10,40 +10,6 @@ workspace: base: /go path: src/code.gitea.io/gitea -steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - - name: tag-pre-condition - pull: always - image: alpine/git - commands: - - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} - when: - event: - - tag ---- -kind: pipeline -name: build - -platform: - os: linux - arch: amd64 - -workspace: - base: /go - path: src/code.gitea.io/gitea - -depends_on: - - init - steps: - name: pre-build pull: always @@ -74,18 +40,16 @@ steps: - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit - - name: generate-build + - name: check pull: always image: golang:1.13 commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - make clean - make golangci-lint - make revive - make swagger-check - make swagger-validate - make test-vendor - - make build environment: GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not GOSUMDB: sum.golang.org @@ -103,9 +67,6 @@ workspace: base: /go path: src/code.gitea.io/gitea -depends_on: - - init - services: - name: mysql pull: default @@ -140,6 +101,36 @@ services: image: gitea/test-openldap:latest steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + when: + event: + exclude: + - pull_request + + - name: tag-pre-condition + pull: always + image: alpine/git + commands: + - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} + when: + event: + - tag + + - name: build + pull: always + image: golang:1.13 + commands: + - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs + - make build + environment: + GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not + GOSUMDB: sum.golang.org + TAGS: bindata sqlite sqlite_unlock_notify + - name: unit-test pull: always image: golang:1.13 @@ -185,6 +176,8 @@ steps: - name: test-sqlite pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -197,6 +190,8 @@ steps: - name: test-mysql pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -216,6 +211,8 @@ steps: - name: tag-test-mysql pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -232,6 +229,8 @@ steps: - name: test-mysql8 pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -245,6 +244,8 @@ steps: - name: test-pgsql pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -258,6 +259,8 @@ steps: - name: test-mssql pull: always image: golang:1.13 + depends_on: + - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -322,9 +325,6 @@ trigger: event: - push -depends_on: - - init - steps: - name: download pull: always @@ -591,7 +591,7 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - build + - compatibility trigger: ref: @@ -663,7 +663,7 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - build + - compatibility trigger: ref: From 25853375d94c0499231528e4fc5f352827a14637 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:03:03 +0100 Subject: [PATCH 04/20] ci: try re-ordering for optimizing time --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index ae57d2a20b619..c3ed0293e32f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,7 +25,6 @@ steps: GO111MODULE: on GOPROXY: off commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag - name: build-linux-386 @@ -37,7 +36,6 @@ steps: GOOS: linux GOARCH: 386 commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit - name: check From d91127affc3b5c69b9dfc818a8710a1ca5fac334 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:07:27 +0100 Subject: [PATCH 05/20] ci: try re-ordering for optimizing time --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index c3ed0293e32f0..5821d6cfb8d09 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: compatibility +name: compliance platform: os: linux @@ -589,7 +589,7 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - compatibility + - compliance trigger: ref: @@ -661,7 +661,7 @@ workspace: path: src/code.gitea.io/gitea depends_on: - - compatibility + - compliance trigger: ref: From 24aaa2d60d1dac915155b50f446e9ff51863cd1b Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:43:10 +0100 Subject: [PATCH 06/20] ci: try re-ordering for optimizing time --- .drone.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5821d6cfb8d09..eb1ffea4201b3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -167,6 +167,8 @@ steps: environment: GOPROXY: off TAGS: bindata + depends_on: + - tag-pre-condition when: event: - tag @@ -188,8 +190,6 @@ steps: - name: test-mysql pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -199,6 +199,8 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 + depends_on: + - build when: branch: - master @@ -209,8 +211,6 @@ steps: - name: tag-test-mysql pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -220,6 +220,8 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 + depends_on: + - build when: event: - tag @@ -227,8 +229,6 @@ steps: - name: test-mysql8 pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -238,12 +238,12 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 + depends_on: + - build - name: test-pgsql pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -253,12 +253,12 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 + depends_on: + - build - name: test-mssql pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -268,6 +268,8 @@ steps: GOPROXY: off TAGS: bindata TEST_LDAP: 1 + depends_on: + - build - name: generate-coverage pull: always @@ -304,7 +306,7 @@ steps: event: - push - pull_request - + --- kind: pipeline name: translations From c60de5db1cf8b5984c3014a57da6490f06c8d980 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:49:04 +0100 Subject: [PATCH 07/20] ci: try offloading mysql8 to arm64 --- .drone.yml | 80 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/.drone.yml b/.drone.yml index eb1ffea4201b3..d18d344f72d61 100644 --- a/.drone.yml +++ b/.drone.yml @@ -73,13 +73,6 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: test - - name: mysql8 - pull: default - image: mysql:8.0 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea - - name: pgsql pull: default image: postgres:9.5 @@ -226,21 +219,6 @@ steps: event: - tag - - name: test-mysql8 - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-mysql8-migration - - timeout -s ABRT 20m make test-mysql8 - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 1 - depends_on: - - build - - name: test-pgsql pull: always image: golang:1.13 @@ -307,6 +285,64 @@ steps: - push - pull_request + +--- +kind: pipeline +name: testing-mysql8-arm64 + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +services: + - name: mysql8 + pull: default + image: mysql:8.0 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + +steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + when: + event: + exclude: + - pull_request + + - name: build + pull: always + image: golang:1.13 + commands: + - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs + - make build + environment: + GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not + GOSUMDB: sum.golang.org + TAGS: bindata + + - name: test-mysql8 + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-mysql8-migration + - timeout -s ABRT 20m make test-mysql8 + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 0 + depends_on: + - build + --- kind: pipeline name: translations From ec38ee2864f904ef210bd3a626b3d089d0572370 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:51:40 +0100 Subject: [PATCH 08/20] Revert "ci: try offloading mysql8 to arm64" This reverts commit c60de5db1cf8b5984c3014a57da6490f06c8d980. --- .drone.yml | 80 +++++++++++++++--------------------------------------- 1 file changed, 22 insertions(+), 58 deletions(-) diff --git a/.drone.yml b/.drone.yml index d18d344f72d61..eb1ffea4201b3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -73,6 +73,13 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: test + - name: mysql8 + pull: default + image: mysql:8.0 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + - name: pgsql pull: default image: postgres:9.5 @@ -219,6 +226,21 @@ steps: event: - tag + - name: test-mysql8 + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-mysql8-migration + - timeout -s ABRT 20m make test-mysql8 + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 1 + depends_on: + - build + - name: test-pgsql pull: always image: golang:1.13 @@ -285,64 +307,6 @@ steps: - push - pull_request - ---- -kind: pipeline -name: testing-mysql8-arm64 - -platform: - os: linux - arch: arm64 - -workspace: - base: /go - path: src/code.gitea.io/gitea - -services: - - name: mysql8 - pull: default - image: mysql:8.0 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea - -steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - - name: build - pull: always - image: golang:1.13 - commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - - make build - environment: - GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not - GOSUMDB: sum.golang.org - TAGS: bindata - - - name: test-mysql8 - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-mysql8-migration - - timeout -s ABRT 20m make test-mysql8 - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 0 - depends_on: - - build - --- kind: pipeline name: translations From 443efe21b664e4ec6eaa543c41d4cf52e77b44b2 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 06:54:03 +0100 Subject: [PATCH 09/20] ci: try offloading pgsql to arm64 --- .drone.yml | 77 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/.drone.yml b/.drone.yml index eb1ffea4201b3..bd8803db34d94 100644 --- a/.drone.yml +++ b/.drone.yml @@ -80,12 +80,6 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: testgitea - - name: pgsql - pull: default - image: postgres:9.5 - environment: - POSTGRES_DB: test - - name: mssql pull: default image: microsoft/mssql-server-linux:latest @@ -241,21 +235,6 @@ steps: depends_on: - build - - name: test-pgsql - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-pgsql-migration - - timeout -s ABRT 20m make test-pgsql - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 1 - depends_on: - - build - - name: test-mssql pull: always image: golang:1.13 @@ -307,6 +286,62 @@ steps: - push - pull_request +--- +kind: pipeline +name: testing-pgsql-arm64 + +platform: + os: linux + arch: arm64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +services: + - name: pgsql + pull: default + image: postgres:9.5 + environment: + POSTGRES_DB: test + +steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + when: + event: + exclude: + - pull_request + + - name: build + pull: always + image: golang:1.13 + commands: + - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs + - make build + environment: + GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not + GOSUMDB: sum.golang.org + TAGS: bindata sqlite sqlite_unlock_notify + + - name: test-pgsql + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-pgsql-migration + - timeout -s ABRT 20m make test-pgsql + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 0 + depends_on: + - build + --- kind: pipeline name: translations From 91e345450a39ca45a0904188344c5759d72aa1e7 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 08:05:58 +0100 Subject: [PATCH 10/20] ci: activate ldap on arm64 --- .drone.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bd8803db34d94..f813f7573139e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -304,6 +304,9 @@ services: image: postgres:9.5 environment: POSTGRES_DB: test + - name: ldap + pull: default + image: gitea/test-openldap:latest steps: - name: fetch-tags @@ -338,7 +341,7 @@ steps: environment: GOPROXY: off TAGS: bindata - TEST_LDAP: 0 + TEST_LDAP: 1 depends_on: - build From dd88cc49d8dbfa2e5ab2c639ce69dab8ba4b697d Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 08:42:02 +0100 Subject: [PATCH 11/20] ci: test mysql8 in place pgsql arm64 --- .drone.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index f813f7573139e..646d70a336a4a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -73,12 +73,11 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: test - - name: mysql8 + - name: pgsql pull: default - image: mysql:8.0 + image: postgres:9.5 environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea + POSTGRES_DB: test - name: mssql pull: default @@ -220,14 +219,14 @@ steps: event: - tag - - name: test-mysql8 + - name: test-pgsql pull: always image: golang:1.13 commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-mysql8-migration - - timeout -s ABRT 20m make test-mysql8 + - timeout -s ABRT 20m make test-pgsql-migration + - timeout -s ABRT 20m make test-pgsql environment: GOPROXY: off TAGS: bindata @@ -299,11 +298,13 @@ workspace: path: src/code.gitea.io/gitea services: - - name: pgsql + - name: mysql8 pull: default - image: postgres:9.5 + image: mysql/mysql-server:8.0 environment: - POSTGRES_DB: test + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + - name: ldap pull: default image: gitea/test-openldap:latest @@ -328,16 +329,16 @@ steps: environment: GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not GOSUMDB: sum.golang.org - TAGS: bindata sqlite sqlite_unlock_notify + TAGS: bindata - - name: test-pgsql + - name: test-mysql8 pull: always image: golang:1.13 commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-pgsql-migration - - timeout -s ABRT 20m make test-pgsql + - timeout -s ABRT 20m make test-mysql8-migration + - timeout -s ABRT 20m make test-mysql8 environment: GOPROXY: off TAGS: bindata From b1c53ba7eba13d219bcb1f7656523670a7d30471 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 08:43:36 +0100 Subject: [PATCH 12/20] chore: clean un-needed move --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 646d70a336a4a..d6ce4aa66d041 100644 --- a/.drone.yml +++ b/.drone.yml @@ -169,8 +169,6 @@ steps: - name: test-sqlite pull: always image: golang:1.13 - depends_on: - - build commands: - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - apt-get install -y git-lfs @@ -179,6 +177,8 @@ steps: environment: GOPROXY: off TAGS: bindata + depends_on: + - build - name: test-mysql pull: always From e278a9c69f29bb4cb3004cadd4ae4fc6149aeaaf Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 08:55:14 +0100 Subject: [PATCH 13/20] typo --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d6ce4aa66d041..507ac91251d05 100644 --- a/.drone.yml +++ b/.drone.yml @@ -287,7 +287,7 @@ steps: --- kind: pipeline -name: testing-pgsql-arm64 +name: testing-mysql8-arm64 platform: os: linux From 796c14d929a964a89c7d4d1397c8dcd9855716ad Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 17:21:34 +0100 Subject: [PATCH 14/20] ci: revert runnning mysql on arm64 --- .drone.yml | 83 +++++++++++++++--------------------------------------- 1 file changed, 22 insertions(+), 61 deletions(-) diff --git a/.drone.yml b/.drone.yml index 507ac91251d05..c21cebfed2940 100644 --- a/.drone.yml +++ b/.drone.yml @@ -73,6 +73,13 @@ services: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: test + - name: mysql8 + pull: default + image: mysql:8.0 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + - name: pgsql pull: default image: postgres:9.5 @@ -219,6 +226,21 @@ steps: event: - tag + - name: test-mysql8 + pull: always + image: golang:1.13 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - timeout -s ABRT 20m make test-mysql8-migration + - timeout -s ABRT 20m make test-mysql8 + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 1 + depends_on: + - build + - name: test-pgsql pull: always image: golang:1.13 @@ -285,67 +307,6 @@ steps: - push - pull_request ---- -kind: pipeline -name: testing-mysql8-arm64 - -platform: - os: linux - arch: arm64 - -workspace: - base: /go - path: src/code.gitea.io/gitea - -services: - - name: mysql8 - pull: default - image: mysql/mysql-server:8.0 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea - - - name: ldap - pull: default - image: gitea/test-openldap:latest - -steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - - name: build - pull: always - image: golang:1.13 - commands: - - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - - make build - environment: - GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not - GOSUMDB: sum.golang.org - TAGS: bindata - - - name: test-mysql8 - pull: always - image: golang:1.13 - commands: - - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - - apt-get install -y git-lfs - - timeout -s ABRT 20m make test-mysql8-migration - - timeout -s ABRT 20m make test-mysql8 - environment: - GOPROXY: off - TAGS: bindata - TEST_LDAP: 1 - depends_on: - - build - --- kind: pipeline name: translations From ca91ccd1e2a5442edcf65dc46c5b69bf81a051cc Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 00:06:31 +0100 Subject: [PATCH 15/20] ci: run compliance on arm --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c21cebfed2940..a8d55e5687e97 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: compliance platform: os: linux - arch: amd64 + arch: arm64 workspace: base: /go From ce45672d1218ccebb1c7a8415982a84aabde4ddb Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 00:18:53 +0100 Subject: [PATCH 16/20] chore: limit change --- .drone.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index a8d55e5687e97..b1ae27e17194a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -109,15 +109,6 @@ steps: exclude: - pull_request - - name: tag-pre-condition - pull: always - image: alpine/git - commands: - - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} - when: - event: - - tag - - name: build pull: always image: golang:1.13 @@ -159,6 +150,17 @@ steps: - push - pull_request + - name: tag-pre-condition + pull: always + image: alpine/git + commands: + - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} + depends_on: + - build + when: + event: + - tag + - name: tag-test pull: always image: golang:1.13 From 782370978d5cd23edaab6697f9554536b4cb42e4 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 00:47:48 +0100 Subject: [PATCH 17/20] chore: readd maybe need for release fetch-tags --- .drone.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.drone.yml b/.drone.yml index b1ae27e17194a..6e6eee6ac308d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -398,6 +398,12 @@ depends_on: - translations steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + - name: static pull: always image: techknowlogick/xgo:latest @@ -489,6 +495,12 @@ depends_on: - testing steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + - name: static pull: always image: techknowlogick/xgo:latest @@ -634,6 +646,12 @@ trigger: - "refs/tags/**" steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + - name: publish pull: always image: plugins/docker:linux-amd64 @@ -704,6 +722,12 @@ trigger: ref: - refs/heads/master - "refs/tags/**" +steps: + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force - name: publish pull: always From 817757396b1f45d2f8a97cd295473ef56f1c8ca6 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 01:20:26 +0100 Subject: [PATCH 18/20] ci: remove docker-linux-amd64-dry-run --- .drone.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6e6eee6ac308d..04c75891a226e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -592,39 +592,6 @@ steps: event: - push ---- -kind: pipeline -name: docker-linux-amd64-dry-run - -platform: - os: linux - arch: amd64 - -workspace: - base: /go - path: src/code.gitea.io/gitea - -depends_on: - - compliance - -trigger: - ref: - - "refs/pull/**" - -steps: - - name: dryrun - pull: always - image: plugins/docker:linux-amd64 - settings: - dry_run: true - repo: gitea/gitea - tags: linux-amd64 - build_args: - - GOPROXY=off - when: - event: - - pull_request - --- kind: pipeline name: docker-linux-amd64-release From 0715f65b11c37869359aaaa5d22901da512e8184 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 01:26:31 +0100 Subject: [PATCH 19/20] ci: remove docker-linux-amd64-dry-run --- .drone.yml | 56 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 04c75891a226e..b4a7b65c2204d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -594,80 +594,80 @@ steps: --- kind: pipeline -name: docker-linux-amd64-release +name: docker-linux-dry-run platform: os: linux - arch: amd64 + arch: arm64 workspace: base: /go path: src/code.gitea.io/gitea depends_on: - - testing + - compliance trigger: ref: - - refs/heads/master - - "refs/tags/**" + - "refs/pull/**" steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - - - name: publish + - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:linux-arm64 settings: - auto_tag: true - auto_tag_suffix: linux-amd64 + dry_run: true repo: gitea/gitea + tags: linux-arm64 build_args: - GOPROXY=off - password: - from_secret: docker_password - username: - from_secret: docker_username when: event: - exclude: - pull_request --- kind: pipeline -name: docker-linux-arm64-dry-run +name: docker-linux-amd64-release platform: os: linux - arch: arm64 + arch: amd64 workspace: base: /go path: src/code.gitea.io/gitea depends_on: - - compliance + - testing trigger: ref: - - "refs/pull/**" + - refs/heads/master + - "refs/tags/**" steps: - - name: dryrun + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + + - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:linux-amd64 settings: - dry_run: true + auto_tag: true + auto_tag_suffix: linux-amd64 repo: gitea/gitea - tags: linux-arm64 build_args: - GOPROXY=off + password: + from_secret: docker_password + username: + from_secret: docker_username when: event: + exclude: - pull_request --- From 1d26650a4858e6a3e02cf9093c7ff5b841c95bf5 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 13 Jan 2020 01:27:36 +0100 Subject: [PATCH 20/20] Revert "ci: remove docker-linux-amd64-dry-run" This reverts commit 0715f65b11c37869359aaaa5d22901da512e8184. --- .drone.yml | 56 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index b4a7b65c2204d..04c75891a226e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -594,80 +594,80 @@ steps: --- kind: pipeline -name: docker-linux-dry-run +name: docker-linux-amd64-release platform: os: linux - arch: arm64 + arch: amd64 workspace: base: /go path: src/code.gitea.io/gitea depends_on: - - compliance + - testing trigger: ref: - - "refs/pull/**" + - refs/heads/master + - "refs/tags/**" steps: - - name: dryrun + - name: fetch-tags + pull: default + image: docker:git + commands: + - git fetch --tags --force + + - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:linux-amd64 settings: - dry_run: true + auto_tag: true + auto_tag_suffix: linux-amd64 repo: gitea/gitea - tags: linux-arm64 build_args: - GOPROXY=off + password: + from_secret: docker_password + username: + from_secret: docker_username when: event: + exclude: - pull_request --- kind: pipeline -name: docker-linux-amd64-release +name: docker-linux-arm64-dry-run platform: os: linux - arch: amd64 + arch: arm64 workspace: base: /go path: src/code.gitea.io/gitea depends_on: - - testing + - compliance trigger: ref: - - refs/heads/master - - "refs/tags/**" + - "refs/pull/**" steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - - - name: publish + - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:linux-arm64 settings: - auto_tag: true - auto_tag_suffix: linux-amd64 + dry_run: true repo: gitea/gitea + tags: linux-arm64 build_args: - GOPROXY=off - password: - from_secret: docker_password - username: - from_secret: docker_username when: event: - exclude: - pull_request ---