diff --git a/contrib/devtools/build-all.sh b/contrib/devtools/build-all.sh new file mode 100755 --- /dev/null +++ b/contrib/devtools/build-all.sh @@ -0,0 +1,38 @@ +#!/bin/bash -e + +CURRENT_DATE=$(date +%Y-%m-%d) + +build() { + if [[ $1 ]]; then + echo "Running gitian build for $1..." + # Note the path to descriptors assumes vagrant was used. These files are + # within the ABC repository normally. + ./bin/gbuild --commit bitcoin="${COMMIT}" --url bitcoin="${URL}" /vagrant/contrib/gitian-descriptors/gitian-$1.yml + if [ $? -ne 0 ]; then + return 1 + fi + + # Copy outputs to build directory since ./build/out is overwritten with + # each build. + OUTPUT_DIR="/vagrant/build/gitian/$CURRENT_DATE/$1" + mkdir -p $OUTPUT_DIR + cp -r ./build/out/* $OUTPUT_DIR + echo "Build completed for $1. See build/gitian/$1 for generated outputs." + return 0 + fi + return 1 +} + +# Delete any *-res.yml files from older builds +rm ./result/* + +build "osx" || exit 1 +build "win" || exit 1 +build "linux" || exit 1 + +# Copy all the *-res.yml files to their respective directories +# Note: ... || true; is used incase the files do not exist. The script will +# continue without exiting prematurely. +cp ./result/bitcoin-abc-*-osx-res.yml /vagrant/build/gitian/$CURRENT_DATE/osx || true +cp ./result/bitcoin-abc-*-win-res.yml /vagrant/build/gitian/$CURRENT_DATE/win || true +cp ./result/bitcoin-abc-*-linux-res.yml /vagrant/build/gitian/$CURRENT_DATE/linux || true diff --git a/doc/gitian-building.md b/doc/gitian-building.md --- a/doc/gitian-building.md +++ b/doc/gitian-building.md @@ -102,14 +102,7 @@ ```bash URL=https://github.com/bitcoin-abc/bitcoin-abc.git COMMIT=v0.16.0 # or whatever release tag you wish - -# Note the path to descriptors assumes vagrant was used. These files are within the ABC repository normally. -./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} /vagrant/contrib/gitian-descriptors/gitian-linux.yml -# Note: If you plan on signing the binaries generated during this process, be -# sure to copy them from ./build/out/ to /vagrant/gitian/ -# otherwise they will be overwritten by the next gbuild call. -./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} /vagrant/contrib/gitian-descriptors/gitian-win.yml -./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} /vagrant/contrib/gitian-descriptors/gitian-osx.yml +/vagrant/contrib/devtools/build-all.sh ``` Note on the OSX build: If you encounter an error about a missing MacOSX10.11.sdk.tar.gz, then follow these steps: