Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-11-23

* Improve (and fix) entrypoint.sh

2024-02-12

* Convert Action to a container
Expand Down
19 changes: 15 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
#!/bin/bash

set -e

echo ""
echo "linuxdeploy Build Helper Container v2.0.0"
echo "linuxdeploy Build Helper Container v2.0.1"
echo "https://github.com/andy5995/linuxdeploy-build-helper-container"
echo ""

OLDPWD=$PWD

if [ -z "HOSTUID" ]; then
if [ -z "$HOSTUID" ]; then
echo "HOSTUID is not set."
exit 1
fi

if [ -z "$HOSTGID" ]; then
echo "HOSTGID is not set."
exit 1
fi

if [ -z "$1" ]; then
echo "One argument required -- the name of a script to run."
exit 1
fi

usermod -u $HOSTUID builder
su builder -c "PATH=/home/builder/.local/bin:$PATH && cd $OLDPWD && $1"
usermod -u "$HOSTUID" builder
chown -R "$HOSTUID:$HOSTGID" /home/builder

# The docs state to use '-w /workdir when running the container, but switching
# to builder here will change the directory. Using cd to change back...
su builder -l -c "cd $OLDPWD && $1"