forked from matter-labs/zinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·54 lines (49 loc) · 1.12 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -Cex
# Logging level: 'error' | 'warn' | 'info' | 'debug' | 'trace'
case "${1}" in
error)
export LOG_LEVEL=""
;;
warn)
export LOG_LEVEL=""
;;
info)
export LOG_LEVEL="-v"
export CARGO_LOG_LEVEL="--verbose"
;;
debug)
export LOG_LEVEL="-vv"
export RUST_BACKTRACE=1
export CARGO_LOG_LEVEL="--verbose"
;;
trace)
export LOG_LEVEL="-vvv"
export RUST_BACKTRACE="full"
export CARGO_LOG_LEVEL="--verbose"
;;
*)
export LOG_LEVEL=""
;;
esac
# Target build: 'debug' | 'release'
case "${2}" in
debug)
export TARGET_DIRECTORY="debug"
;;
release)
export RELEASE_FLAG="--release"
export TARGET_DIRECTORY="release"
;;
*)
export TARGET_DIRECTORY="debug"
;;
esac
cargo fmt --all
cargo clippy
cargo test
cargo build ${CARGO_LOG_LEVEL} ${RELEASE_FLAG}
source './zandbox/.env'
cargo run ${CARGO_LOG_LEVEL} ${RELEASE_FLAG} --bin 'zandbox' -- ${LOG_LEVEL} \
--network "${NETWORK}" \
--postgresql "${DATABASE_URL}"