Changeset View
Changeset View
Standalone View
Standalone View
contrib/teamcity/ibd.sh
#!/usr/bin/env bash | #!/usr/bin/env bash | ||||
jasonbcox: This file needs another rebase, sorry. | |||||
export LC_ALL=C | export LC_ALL=C | ||||
set -euxo pipefail | set -euxo pipefail | ||||
### | ### | ||||
# Initial Block Download script. | # Initial Block Download script. | ||||
# | # | ||||
# Runs a bitcoind process until initial block download is complete. | # Runs a bitcoind process until initial block download is complete. | ||||
# Forwards the exit code from bitcoind onward. | # Forwards the exit code from bitcoind onward. | ||||
### | ### | ||||
MYPID=$$ | MYPID=$$ | ||||
# Setup | # Setup | ||||
TOPLEVEL=$(git rev-parse --show-toplevel) | |||||
jasonbcoxUnsubmitted Not Done Inline ActionsRather than removing TOPLEVEL and not defining BUILD_DIR, provide reasonable defaults: : "${TOPLEVEL:=$(git rev-parse --show-toplevel)}" : "${BUILD_DIR:=${TOPLEVEL}/build}" This preserves the ability to run this script directly without any setup. jasonbcox: Rather than removing TOPLEVEL and not defining BUILD_DIR, provide reasonable defaults:
```… | |||||
DATA_DIR="${TOPLEVEL}"/ibd | DATA_DIR="${TOPLEVEL}"/ibd | ||||
mkdir -p "${DATA_DIR}" | mkdir -p "${DATA_DIR}" | ||||
DEBUG_LOG="${DATA_DIR}/debug.log" | DEBUG_LOG="${DATA_DIR}/debug.log" | ||||
touch "${DEBUG_LOG}" | touch "${DEBUG_LOG}" | ||||
: "${BITCOIND_BINARY:=}" | : "${BITCOIND_BINARY:=}" | ||||
if [[ -z "${BITCOIND_BINARY}" ]]; then | if [[ -z "${BITCOIND_BINARY}" ]]; then | ||||
BITCOIND_BINARY="${TOPLEVEL}"/build/src/bitcoind | BITCOIND_BINARY="${BUILD_DIR}"/src/bitcoind | ||||
fi | fi | ||||
# Launch bitcoind using this script's parameters | # Launch bitcoind using this script's parameters | ||||
"${BITCOIND_BINARY}" "-datadir=${DATA_DIR}" "$@" & | "${BITCOIND_BINARY}" "-datadir=${DATA_DIR}" "$@" & | ||||
BITCOIND_PID=$! | BITCOIND_PID=$! | ||||
cleanup() { | cleanup() { | ||||
# Cleanup background processes spawned by this script. | # Cleanup background processes spawned by this script. | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
This file needs another rebase, sorry.