Help script in docker-auto-build.sh
adding openssl-dev requirements for buliding json-api to Dockerfile
This commit is contained in:
parent
aae59e7d68
commit
751e24b867
@ -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
|
||||
|
@ -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 <<EOF
|
||||
Script for BUILDING(not running/installing services) all relevant server binaries
|
||||
Primarily to be used in docker images
|
||||
|
||||
Available options:
|
||||
--no-cargo-cache
|
||||
Cost: Slower compilation times after the first build as everything must be rebuilt
|
||||
Benefit: less disk usage as it cleans up unused files after a 'cargo build --release'
|
||||
EOF
|
||||
|
||||
else
|
||||
for arg in $@;do
|
||||
if [ "$arg" = "--no-cargo-cache" ];then
|
||||
no_cargo_cache=true
|
||||
fi
|
||||
|
||||
done
|
||||
build_cargo_targets
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user