rc
This commit is contained in:
parent
d56de33b21
commit
a122babb95
2 changed files with 9 additions and 10 deletions
docker/apphub
|
@ -1,4 +1,4 @@
|
|||
# modify time: 202310191050, you can modify here to trigger Docker Build action
|
||||
# modify time: 202310191112, you can modify here to trigger Docker Build action
|
||||
|
||||
FROM python:3.10-bullseye AS buildstage
|
||||
LABEL maintainer="Websoft9<help@websoft9.com>"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
try_times=3
|
||||
try_times=5
|
||||
|
||||
# start by supervisord
|
||||
/usr/bin/supervisord
|
||||
|
@ -12,31 +12,30 @@ supervisorctl start apphub
|
|||
# set git user and email
|
||||
for ((i=0; i<$try_times; i++)); do
|
||||
set +e
|
||||
username=$(apphub getconfig --section gitea --key user_name)
|
||||
email=$(apphub getconfig --section gitea --key email)
|
||||
username=$(apphub getconfig --section gitea --key user_name 2>/dev/null)
|
||||
email=$(apphub getconfig --section gitea --key email 2>/dev/null)
|
||||
set -e
|
||||
if [ -n "$username" ] && [ -n "$email" ]; then
|
||||
break
|
||||
fi
|
||||
echo "Command failed, retrying..."
|
||||
echo "Wait for service running, retrying..."
|
||||
sleep 3
|
||||
done
|
||||
|
||||
echo $username
|
||||
echo $email
|
||||
|
||||
if [[ -n "$username" ]]; then
|
||||
echo "git config --global user.name $username"
|
||||
git config --global user.name "$username"
|
||||
else
|
||||
echo "username is null"
|
||||
echo "username is null, git config username failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
regex="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
|
||||
if [[ $email =~ $regex ]]; then
|
||||
echo "git config --global user.email $email"
|
||||
git config --global user.email "$email"
|
||||
else
|
||||
echo "Not have correct email"
|
||||
echo "Not have correct email, git config email failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue