Feature/autobuild branch specific (#5)

docker ci will create tag depending on source branch
This commit is contained in:
jusito
2020-09-27 21:32:03 +02:00
committed by GitHub
parent 0415e30719
commit f516b8df91
5 changed files with 35 additions and 20 deletions

View File

@ -1,4 +1,6 @@
FROM jusito/docker-ttt:lgsm_debian
ARG SUFFIX=""
FROM jusito/docker-ttt:lgsm_debian${SUFFIX}
# Const \\ Overwrite Env \\ Configs optional
ENV CSS_PATH="/home/steam/addons/css" \

View File

@ -12,14 +12,15 @@ CFG_PATH="${SERVER_PATH}/garrysmod/cfg/gmodserver.cfg"
function configReplace() {
source="$1"
target="$2"
target="\"$(echo "$target" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')\""
count=$(grep -Poc "($source).+" "${CFG_PATH}")
echo "[initConfig.sh]Request for replacing $source to $target, source is found $count times"
if [ "$count" == "1" ]; then
sed -Ei "s/${source}.*/${source} ${target}/g" "${CFG_PATH}"
sed -Ei "/${source}.*/d" "${CFG_PATH}"
echo "$target" >> "${CFG_PATH}"
elif [ "$count" == "0" ]; then
echo "" >> "${CFG_PATH}"