---
kind: pipeline
+type: docker
name: compliance
platform:
---
kind: pipeline
+type: docker
name: testing-amd64
platform:
exclude:
- pull_request
- - name: build
- pull: always
- image: golang:1.17
- commands:
- - make backend
- 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: tag-pre-condition
pull: always
image: drone/git
commands:
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
- - name: fix-permissions
+ - name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- - chown -R gitea:gitea .
+ - ./build/test-env-prepare.sh
+
+ - name: build
+ pull: always
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ user: gitea
+ commands:
+ - ./build/test-env-check.sh
+ - make backend
+ 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
+ depends_on:
+ - prepare-test-env
- name: unit-test
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
exclude:
- pull_request
- - name: fix-permissions
+ - name: prepare-test-env
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
commands:
- - chown -R gitea:gitea .
+ - ./build/test-env-prepare.sh
- name: build
pull: always
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
user: gitea
commands:
+ - ./build/test-env-check.sh
- make backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata gogit sqlite sqlite_unlock_notify
+ depends_on:
+ - prepare-test-env
- name: test-sqlite
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
---
kind: pipeline
+type: docker
name: update_gitignore_and_licenses
platform:
---
kind: pipeline
+type: docker
name: release-latest
platform:
---
kind: pipeline
+type: docker
name: docs
platform:
---
kind: pipeline
+type: docker
name: docker-linux-amd64-release-version
platform:
---
kind: pipeline
+type: docker
name: docker-linux-amd64-release
platform:
---
kind: pipeline
+type: docker
name: docker-linux-arm64-dry-run
platform:
---
kind: pipeline
+type: docker
name: docker-linux-arm64-release-version
platform:
---
kind: pipeline
+type: docker
name: docker-linux-arm64-release
platform:
- pull_request
---
kind: pipeline
+type: docker
name: docker-manifest-version
platform:
---
kind: pipeline
+type: docker
name: docker-manifest
platform:
---
kind: pipeline
+type: docker
name: notifications
platform:
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ ! -f ./build/test-env-check.sh ]; then
+ echo "${0} can only be executed in gitea source root directory"
+ exit 1
+fi
+
+
+echo "check uid ..."
+
+# the uid of gitea defined in "https://gitea.com/gitea/test-env" is 1000
+gitea_uid=$(id -u gitea)
+if [ "$gitea_uid" != "1000" ]; then
+ echo "The uid of linux user 'gitea' is expected to be 1000, but it is $gitea_uid"
+ exit 1
+fi
+
+cur_uid=$(id -u)
+if [ "$cur_uid" != "0" -a "$cur_uid" != "$gitea_uid" ]; then
+ echo "The uid of current linux user is expected to be 0 or $gitea_uid, but it is $cur_uid"
+ exit 1
+fi