freechat/json-api/build.sh
shockrah 4323156242 Building and testing against proper nginx setup now
! No longer pipeline ready because the docker image is out of date with this change
2021-02-11 22:28:20 -08:00

42 lines
870 B
Bash
Executable File

#!/bin/bash
_help() {
cat <<EOF
Usage: ./build.sh [-h|-t|-b|-r]
h Help : shows this command
f Full : Runs all available tests including the cargo ones
t Test : Runs All tests from cargo tests to client tests
T Test Realse : Runs tests against release build
b Build : Builds dev build with 'cargo build'
r Release : Builds release build with --release flag
EOF
}
[[ -z $1 ]] && _help && exit 0
diesel database reset
export CARGO_BIN=$HOME/.cargo/bin/cargo
full=
testing() {
release_opt=$1
cargo build $release_opt
source ./client-tests/bin/activate
python3 client-tests/client.py
# if [ ! -z $full ];then
# cargo test $release_opt
# fi
}
while getopts ":fhtTbr" arg; do
case ${arg} in
f) full=true;;
h) echo help command;;
t) testing;;
T) testing --release;;
b) cargo build;;
r) cargo build --release;;
*) _help;;
esac
done