feat(bash): startup-scripts reworked + bash scripts workflow integration (#22401)

This commit is contained in:
Yehonal
2025-07-01 15:35:54 +02:00
committed by GitHub
parent d3130f0d39
commit e1b2689c3a
40 changed files with 4125 additions and 384 deletions

View File

@@ -1,3 +1,7 @@
#!/usr/bin/env bash
# Set SUDO variable - one liner
SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "")
function comp_clean() {
DIRTOCLEAN=${BUILDPATH:-var/build/obj}
@@ -134,23 +138,21 @@ function comp_compile() {
mkdir -p "$confDir"
echo "Cmake install..."
sudo cmake --install . --config $CTYPE
$SUDO cmake --install . --config $CTYPE
popd >> /dev/null || exit 1
# set all aplications SUID bit
echo "Setting permissions on binary files"
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chown root:root -- {} +
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chmod u+s -- {} +
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chown root:root -- {} +
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chmod u+s -- {} +
if [[ -n "$DOCKER" ]]; then
[[ -f "$confDir/worldserver.conf.dist" ]] && \
cp -nv "$confDir/worldserver.conf.dist" "$confDir/worldserver.conf"
[[ -f "$confDir/authserver.conf.dist" ]] && \
cp -nv "$confDir/authserver.conf.dist" "$confDir/authserver.conf"
[[ -f "$confDir/dbimport.conf.dist" ]] && \
cp -nv "$confDir/dbimport.conf.dist" "$confDir/dbimport.conf"
fi
[[ -f "$confDir/worldserver.conf.dist" ]] && \
cp -v --update=none "$confDir/worldserver.conf.dist" "$confDir/worldserver.conf"
[[ -f "$confDir/authserver.conf.dist" ]] && \
cp -v --update=none "$confDir/authserver.conf.dist" "$confDir/authserver.conf"
[[ -f "$confDir/dbimport.conf.dist" ]] && \
cp -v --update=none "$confDir/dbimport.conf.dist" "$confDir/dbimport.conf"
echo "Done"
;;

View File

@@ -10,7 +10,7 @@ fi
function ac_on_after_build() {
# move the run engine
cp -rvf "$AC_PATH_APPS/startup-scripts/"* "$BINPATH"
cp -rvf "$AC_PATH_APPS/startup-scripts/src/"* "$BINPATH"
}
registerHooks "ON_AFTER_BUILD" ac_on_after_build