Add service name to backend deploy and integration test
This commit is contained in:
parent
c7e88ff2be
commit
e7fc52760e
@ -36,7 +36,7 @@ backend-deploy-and-test-bitcoin:
|
|||||||
- configs/coins/bitcoin.json
|
- configs/coins/bitcoin.json
|
||||||
tags:
|
tags:
|
||||||
- blockbook
|
- blockbook
|
||||||
script: ./contrib/scripts/backend-deploy-and-test.sh bitcoin bitcoin=main debug.log
|
script: ./contrib/scripts/backend-deploy-and-test.sh bitcoin
|
||||||
|
|
||||||
backend-deploy-and-test-bitcoin_testnet:
|
backend-deploy-and-test-bitcoin_testnet:
|
||||||
stage: backend-deploy-and-test
|
stage: backend-deploy-and-test
|
||||||
@ -47,4 +47,4 @@ backend-deploy-and-test-bitcoin_testnet:
|
|||||||
- configs/coins/bitcoin_testnet.json
|
- configs/coins/bitcoin_testnet.json
|
||||||
tags:
|
tags:
|
||||||
- blockbook
|
- blockbook
|
||||||
script: ./contrib/scripts/backend-deploy-and-test.sh bitcoin_testnet bitcoin=test testnet3/debug.log
|
script: ./contrib/scripts/backend-deploy-and-test.sh bitcoin_testnet bitcoin-testnet bitcoin=test testnet3/debug.log
|
||||||
|
|||||||
@ -1,27 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ $# -lt 1 ]
|
if [ $# -ne 1 ] && [ $# -ne 4 ]
|
||||||
then
|
then
|
||||||
echo "Usage: $(basename $(readlink -f $0)) coin [coin_test] [backend log file]" 1>&2
|
echo -e "Usage:\n\n$(basename $(readlink -f $0)) coin service_name coin_test backend_log_file\n\nor\n\n$(basename $(readlink -f $0)) coin\nin which case service_name, coin_test and backend_log_file are derived from coin or default" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COIN=$1
|
COIN=$1
|
||||||
COIN_TEST=$2
|
SERVICE=$2
|
||||||
LOGFILE=$3
|
COIN_TEST=$3
|
||||||
|
LOGFILE=$4
|
||||||
|
|
||||||
[ -z "${BACKEND_TIMEOUT}" ] && BACKEND_TIMEOUT=15s
|
[ -z "${BACKEND_TIMEOUT}" ] && BACKEND_TIMEOUT=15s
|
||||||
|
[ -z "${SERVICE}" ] && SERVICE="${COIN}"
|
||||||
[ -z "${COIN_TEST}" ] && COIN_TEST="${COIN}=main"
|
[ -z "${COIN_TEST}" ] && COIN_TEST="${COIN}=main"
|
||||||
[ -z "${LOGFILE}" ] && LOGFILE=debug.log
|
[ -z "${LOGFILE}" ] && LOGFILE=debug.log
|
||||||
|
|
||||||
|
echo "Running: $(basename $(readlink -f $0)) ${COIN} ${SERVICE} ${COIN_TEST} ${LOGFILE}"
|
||||||
|
|
||||||
rm build/*.deb
|
rm build/*.deb
|
||||||
make "deb-backend-${COIN}"
|
make "deb-backend-${COIN}"
|
||||||
|
|
||||||
PACKAGE=$(ls "./build/backend-${COIN}*.deb")
|
PACKAGE=$(ls ./build/backend-${SERVICE}*.deb)
|
||||||
[ -z "${PACKAGE}" ] && echo "Package not found" && exit 1
|
[ -z "${PACKAGE}" ] && echo "Package not found" && exit 1
|
||||||
|
|
||||||
sudo /usr/bin/dpkg -i "${PACKAGE}" || exit 1
|
sudo /usr/bin/dpkg -i "${PACKAGE}" || exit 1
|
||||||
sudo /bin/systemctl restart "backend-${COIN}" || exit 1
|
sudo /bin/systemctl restart "backend-${SERVICE}" || exit 1
|
||||||
timeout ${BACKEND_TIMEOUT} tail -f "/opt/coins/data/${COIN}/backend/${LOGFILE}"
|
|
||||||
make test-integration ARGS="-v -run=TestIntegration/${COIN_TEST}"
|
|
||||||
|
|
||||||
|
echo "Waiting for backend startup for ${BACKEND_TIMEOUT}"
|
||||||
|
timeout ${BACKEND_TIMEOUT} tail -f "/opt/coins/data/${COIN}/backend/${LOGFILE}"
|
||||||
|
|
||||||
|
make test-integration ARGS="-v -run=TestIntegration/${COIN_TEST}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user