Merge #13368: Update gitian-build.sh for docker

86967b2e35 Add option to use docker for gitian-build.sh (Andrew Chow)

Pull request description:

  Updates gitian-build.sh script for the docker virtualization method recently added to gitian-builder.

  Second commit depends on https://github.com/devrandom/gitian-builder/pull/185

Tree-SHA512: 0fa50b6c1be35a7a39f4a82816369637d3d0082922ac9876b80ae8156c795dec0ff34ad384b5348777042df8ddb6a72bbaeddd7002ef80557b10e2acf46632aa
This commit is contained in:
MarcoFalke 2018-07-15 17:26:12 -04:00
commit c0f1569557
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25

View file

@ -22,6 +22,7 @@ url=https://github.com/bitcoin/bitcoin
proc=2 proc=2
mem=2000 mem=2000
lxc=true lxc=true
docker=false
osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
scriptName=$(basename -- "$0") scriptName=$(basename -- "$0")
@ -49,6 +50,7 @@ Options:
-j Number of processes to use. Default 2 -j Number of processes to use. Default 2
-m Memory to allocate in MiB. Default 2000 -m Memory to allocate in MiB. Default 2000
--kvm Use KVM instead of LXC --kvm Use KVM instead of LXC
--docker Use Docker instead of LXC
--setup Set up the Gitian building environment. Uses LXC. If you want to use KVM, use the --kvm option. Only works on Debian-based systems (Ubuntu, Debian) --setup Set up the Gitian building environment. Uses LXC. If you want to use KVM, use the --kvm option. Only works on Debian-based systems (Ubuntu, Debian)
--detach-sign Create the assert file for detached signing. Will not commit anything. --detach-sign Create the assert file for detached signing. Will not commit anything.
--no-commit Do not commit anything to git --no-commit Do not commit anything to git
@ -157,6 +159,16 @@ while :; do
--kvm) --kvm)
lxc=false lxc=false
;; ;;
# docker
--docker)
if [[ $lxc = false ]]
then
echo 'Error: cannot have both kvm and docker'
exit 1
fi
lxc=false
docker=true
;;
# Detach sign # Detach sign
--detach-sign) --detach-sign)
signProg="true" signProg="true"
@ -182,6 +194,12 @@ then
export USE_LXC=1 export USE_LXC=1
fi fi
# Setup docker
if [[ $docker = true ]]
then
export USE_DOCKER=1
fi
# Check for OSX SDK # Check for OSX SDK
if [[ ! -e "gitian-builder/inputs/MacOSX10.11.sdk.tar.gz" && $osx == true ]] if [[ ! -e "gitian-builder/inputs/MacOSX10.11.sdk.tar.gz" && $osx == true ]]
then then
@ -239,6 +257,10 @@ then
then then
sudo apt-get install lxc sudo apt-get install lxc
bin/make-base-vm --suite trusty --arch amd64 --lxc bin/make-base-vm --suite trusty --arch amd64 --lxc
elif [[ -n "$USE_DOCKER" ]]
then
sudo apt-get install docker-ce
bin/make-base-vm --suite trusty --arch amd64 --docker
else else
bin/make-base-vm --suite trusty --arch amd64 bin/make-base-vm --suite trusty --arch amd64
fi fi