* Fixed issue with spacing in help param processing

+ Not caching cargo builds in default docker container
This commit is contained in:
shockrah 2021-01-25 20:42:11 -08:00
parent 462fe463f7
commit ea17628827
2 changed files with 21 additions and 10 deletions

View File

@ -6,6 +6,7 @@
cargo_targets="json-api" cargo_targets="json-api"
no_cargo_cache=false no_cargo_cache=false
ask_help=false
mkdir -p bin/ mkdir -p bin/
# Statically built binaries make this part really easy # Statically built binaries make this part really easy
@ -35,7 +36,7 @@ build_cargo_targets() {
if [ -z $1 ];then show_help() {
cat <<EOF cat <<EOF
Script for BUILDING(not running/installing services) all relevant server binaries Script for BUILDING(not running/installing services) all relevant server binaries
Primarily to be used in docker images Primarily to be used in docker images
@ -46,13 +47,25 @@ Available options:
Benefit: less disk usage as it cleans up unused files after a 'cargo build --release' Benefit: less disk usage as it cleans up unused files after a 'cargo build --release'
EOF EOF
else }
for arg in $@;do
if [ "$arg" = "--no-cargo-cache" ];then
no_cargo_cache=true
fi
done for arg in $@;do
if [ "$arg" = "--no-cargo-cache" ];then
no_cargo_cache=true
fi
if [ "$arg" = "--help" ];then ask_help=true; fi
if [ "$arg" = "-h" ];then ask_help=true; fi
done
if [ $ask_help = "true" ];then
# show help and quit
show_help
else
# normal building process
build_cargo_targets build_cargo_targets
fi fi

View File

@ -12,7 +12,5 @@ RUN apk add git
# Now we being the freechat installation process # Now we being the freechat installation process
RUN git clone https://gitlab.com/shockrah/freechat.git/ /opt/freechat/ RUN git clone https://gitlab.com/shockrah/freechat.git/ /opt/freechat/
RUN cd /opt/freechat/ RUN sh /opt/freechat/docker-auto-build.sh --no-cargo-cache
RUN sh docker-auto-build.sh
RUN /opt/