File tree Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -207,15 +207,16 @@ steps:
207
207
commands :
208
208
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
209
209
210
- - name : fix-permissions
210
+ - name : prepare-test-env
211
211
image : gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
212
212
commands :
213
- - chown -R gitea:gitea .
213
+ - ./build/test-env-prepare.sh
214
214
215
215
- name : unit-test
216
216
image : gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
217
217
user : gitea
218
218
commands :
219
+ - ./build/test-env-check.sh
219
220
- make unit-test-coverage test-check
220
221
environment :
221
222
GOPROXY : off
@@ -353,16 +354,17 @@ steps:
353
354
exclude :
354
355
- pull_request
355
356
356
- - name : fix-permissions
357
+ - name : prepare-test-env
357
358
image : gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
358
359
commands :
359
- - chown -R gitea:gitea .
360
+ - ./build/test-env-prepare.sh
360
361
361
362
- name : build
362
363
pull : always
363
364
image : gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
364
365
user : gitea
365
366
commands :
367
+ - ./build/test-env-check.sh
366
368
- make backend
367
369
environment :
368
370
GOPROXY : https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ if [ ! -f ./build/test-env-check.sh ]; then
6
+ echo " ${0} can only be executed in gitea source root directory"
7
+ exit 1
8
+ fi
9
+
10
+
11
+ echo " check uid ..."
12
+
13
+ # the uid of gitea defined in "https://gitea.com/gitea/test-env" is 1000
14
+ gitea_uid=$( id -u gitea)
15
+ if [ " $gitea_uid " != " 1000" ]; then
16
+ echo " The uid of linux user 'gitea' is expected to be 1000, but it is $gitea_uid "
17
+ exit 1
18
+ fi
19
+
20
+ cur_uid=$( id -u)
21
+ if [ " $cur_uid " != " 0" -a " $cur_uid " != " $gitea_uid " ]; then
22
+ echo " The uid of current linux user is expected to be 0 or $gitea_uid , but it is $cur_uid "
23
+ exit 1
24
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ if [ ! -f ./build/test-env-prepare.sh ]; then
6
+ echo " ${0} can only be executed in gitea source root directory"
7
+ exit 1
8
+ fi
9
+
10
+ echo " change the owner of files to gitea ..."
11
+ chown -R gitea:gitea .
You can’t perform that action at this time.
0 commit comments