Gracefully fail if build.sh fail

This commit is contained in:
nicolas.dorier 2019-11-07 22:31:51 +09:00
parent ec7bca1991
commit 7360cec929
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 12 additions and 4 deletions

View File

@ -450,7 +450,12 @@ if $HAS_DOCKER; then
fi
# Generate the docker compose in BTCPAY_DOCKER_COMPOSE
$HAS_DOCKER && . ./build.sh
if $HAS_DOCKER; then
if ! ./build.sh; then
echo "Failed to generate the docker-compose"
return
fi
fi
if [[ "$BTCPAYGEN_OLD_PREGEN" == "true" ]]; then
cp Generated/docker-compose.generated.yml $BTCPAY_DOCKER_COMPOSE

View File

@ -38,9 +38,12 @@ if ! [ -f "/etc/docker/daemon.json" ] && [ -w "/etc/docker" ]; then
}" > /etc/docker/daemon.json
echo "Setting limited log files in /etc/docker/daemon.json"
fi
set -e
. ./build.sh
set +e
if ! ./build.sh; then
echo "Failed to generate the docker-compose"
exit 1
fi
if [ "$BTCPAYGEN_OLD_PREGEN" == "true" ]; then
cp Generated/docker-compose.generated.yml $BTCPAY_DOCKER_COMPOSE
cp Generated/torrc.tmpl "$(dirname "$BTCPAY_DOCKER_COMPOSE")/torrc.tmpl"