summaryrefslogtreecommitdiffstats
path: root/build/test-env-check.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /build/test-env-check.sh
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'build/test-env-check.sh')
-rwxr-xr-xbuild/test-env-check.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/test-env-check.sh b/build/test-env-check.sh
new file mode 100755
index 0000000..38e5a28
--- /dev/null
+++ b/build/test-env-check.sh
@@ -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