From 2a797d8323bf9a5d887702ec014e638692494f4f Mon Sep 17 00:00:00 2001 From: gdm85 Date: Fri, 16 Jan 2015 20:26:03 +0100 Subject: [PATCH] Add environment option to not dispose containers (NOPURGE) Improve in-comments documentation for various options --- docker/scripts/bitcoin-gitian-build.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docker/scripts/bitcoin-gitian-build.sh b/docker/scripts/bitcoin-gitian-build.sh index 721a5f5..20019b1 100755 --- a/docker/scripts/bitcoin-gitian-build.sh +++ b/docker/scripts/bitcoin-gitian-build.sh @@ -4,10 +4,14 @@ ## @author gdm85 ## ## Automatically build latest version of Bitcoin Core using -## Docker containers (LXC) + KVM. +## Docker containers (nested LXC). ## ## User can specify target operative systems as arguments. -## +## Several optional environment variables condition the build: +## - OUTPUTDIR - where input/output volume directories will be read/created +## - SIGNER - id of signer (no signature will be attempted, just directory structure created) +## - COMMIT - commit/branch to use for build, by default is latest tag +## - NOPURGE - set to non-empty to not dispose containers after build # SCRIPTS=$(dirname $(readlink -m $0)) || exit $? @@ -158,12 +162,14 @@ echo "Building bitcoin (${HCOMMIT}) for $@" && \ build_all ${CREATED[@]} $@ RV=$? -## cleanup -#echo "Cleaning up created containers..." -for CID in $CREATED; do - docker stop $CID - docker rm $CID -done +if [ -z "$NOPURGE" ]; then + ## cleanup + #echo "Cleaning up created containers..." + for CID in $CREATED; do + docker stop $CID + docker rm $CID + done +fi ## return build exit code if [ $RV -eq 0 ]; then