unity-builder/dist/platforms/ubuntu/entrypoint.sh

19 lines
652 B
Bash
Raw Normal View History

2019-11-30 19:27:08 +00:00
#!/usr/bin/env bash
# Get host user/group info so we create files with the correct ownership
2023-11-20 07:08:06 +00:00
USERNAME=$(stat -c '%U' "$GITHUB_WORKSPACE/$PROJECT_PATH")
USERID=$(stat -c '%u' "$GITHUB_WORKSPACE/$PROJECT_PATH")
GROUPNAME=$(stat -c '%G' "$GITHUB_WORKSPACE/$PROJECT_PATH")
GROUPID=$(stat -c '%g' "$GITHUB_WORKSPACE/$PROJECT_PATH")
2019-11-30 19:27:08 +00:00
2023-11-20 07:14:05 +00:00
groupadd -g $GROUPID $GROUPNAME
useradd -u $USERID -g $GROUPID $USERNAME
usermod -aG $GROUPNAME $USERNAME
mkdir -p "/home/$USERNAME"
chown $USERNAME:$GROUPNAME "/home/$USERNAME"
# Switch to the host user so we can create files with the correct ownership
2023-11-20 07:42:00 +00:00
su - $USERNAME -Ec "$SHELL -c 'source /steps/runsteps.sh'"
2023-11-20 07:38:26 +00:00
exit $?