forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare and check test env during CI (go-gitea#17725)
This PR should resolve the permission problems during CI, if the uid doesn't match, a more clear message is shown. * CI fails with unknown permission problems go-gitea#17710 The new drone step dependencies: (root)prepare-test-env -> (gitea)build -> (gitea)test
- Loading branch information
1 parent
62c8039
commit 78ae65c
Showing
3 changed files
with
69 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ ! -f ./build/test-env-prepare.sh ]; then | ||
echo "${0} can only be executed in gitea source root directory" | ||
exit 1 | ||
fi | ||
|
||
echo "change the owner of files to gitea ..." | ||
chown -R gitea:gitea . |