diff --git a/Dockerfile b/Dockerfile index 559e2bb..5bb4f41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ # First we simply install all the things we may need to build/ RUN apk add mysql RUN apk add nginx -RUN cargo +RUN apk add openssl-dev +RUN apk add cargo RUN apk add git # Now we being the freechat installation process diff --git a/docker-auto-build.sh b/docker-auto-build.sh index 30a29c2..65797d5 100644 --- a/docker-auto-build.sh +++ b/docker-auto-build.sh @@ -1,26 +1,58 @@ #!/bin/sh +# Author: shockrah # Building cargo_targets="json-api" +no_cargo_cache=false + mkdir -p bin/ # Statically built binaries make this part really easy -for target in $cargo_targets;do - echo ================================================ - echo = - echo = - echo = - echo = Building $target - echo = - echo = - echo = - echo ================================================ - cd $target - cargo build --release - cp target/release/$target ../bin/ - cd ../ -done +build_cargo_targets() { + for target in $cargo_targets;do + echo ================================================ + echo = + echo = + echo = + echo = Building $target + echo = + echo = + echo = + echo ================================================ + cd $target + + cargo build --release + cp target/release/$target ../bin/ + + if [ $no_cargo_cache = "true" ];then + cargo clean + fi + + cd ../ + done +} -echo Done building + +if [ -z $1 ];then +cat <