Files
archery/docker/scripts/entrypoint.sh
Cory Sanin 9fe86c4114
All checks were successful
App Image CI / Build app image (push) Successful in -1m24s
Docker Image CI / Build build images (arch) (push) Successful in -1s
Docker Image CI / Build build images (artix) (push) Successful in -25s
NPM Audit Check / Check NPM audit (push) Successful in -2m10s
support for a post-entrypoint script
2025-10-28 17:17:34 -05:00

56 lines
991 B
Bash
Executable File

#!/bin/sh
if [ -n "$DEP" ] && [ "$DEP" != "stable" ]
then
sudo cp "/scripts/pacman.conf/pacman.$DEP.conf" "/etc/pacman.conf" && \
sudo pacman -Syu --noconfirm --noprogressbar
fi
if [ -z "$REPO" ]
then
/bin/bash
exit $?;
fi
checkoutCommit() {
if [ -n "$COMMIT" ]
then
git checkout "$COMMIT"
fi
}
applyPatch() {
if [ -n "$PATCH" ]
then
printf "$PATCH" > ../build.patch && \
patch --strip=1 --input=../build.patch
fi
}
postEntrypoint() {
if [ -n "$POST" ] && [ -x post-entrypoint.sh ] ; then
./post-entrypoint.sh
fi
}
changeDir() {
if [ -n "$CD" ]
then
cd "$CD"
fi
}
DIR="${WORKSPACE:-/home/user/pkg}"
if [ ! -d "$DIR" ]; then
git clone "$REPO" "$DIR" || exit $?
fi
cd "$DIR" && \
touch archery && \
checkoutCommit && \
applyPatch && \
sudo pacman -Syu --noconfirm --noprogressbar &&\
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive && \
postEntrypoint
exit $?;