Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions contrib/gitian-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ url=https://github.com/dashpay/dash
proc=2
mem=2000
lxc=true
docker=false
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
scriptName=$(basename -- "$0")
Expand All @@ -47,8 +48,10 @@ Options:
-o|--os Specify which Operating Systems the build is for. Default is lwx. l for linux, w for windows, x for osx
-j Number of processes to use. Default 2
-m Memory to allocate in MiB. Default 2000
--kvm Use KVM instead of LXC
--setup Setup the gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)
--kvm Use KVM
--lxc Use LXC
--docker Use Docker
--setup Setup the gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. If you want to use Docker, use --docker. Only works on Debian-based systems (Ubuntu, Debian)
--detach-sign Create the assert file for detached signing. Will not commit anything.
--no-commit Do not commit anything to git
-h|--help Print this help message
Expand Down Expand Up @@ -78,7 +81,7 @@ while :; do
-S|--signer)
if [ -n "$2" ]
then
SIGNER=$2
SIGNER="$2"
shift
else
echo 'Error: "--signer" requires a non-empty argument.'
Expand Down Expand Up @@ -153,8 +156,19 @@ while :; do
fi
;;
# kvm
--lxc)
lxc=true
docker=false
;;
# kvm
--kvm)
lxc=false
docker=false
;;
# docker
--docker)
lxc=false
docker=true
;;
# Detach sign
--detach-sign)
Expand All @@ -181,6 +195,9 @@ then
export USE_LXC=1
export LXC_BRIDGE=lxcbr0
sudo ifconfig lxcbr0 up 10.0.3.2
elif [[ $docker = true ]]
then
export USE_DOCKER=1
fi

# Check for OSX SDK
Expand All @@ -193,7 +210,7 @@ fi
# Get signer
if [[ -n"$1" ]]
then
SIGNER=$1
SIGNER="$1"
shift
fi

Expand All @@ -206,7 +223,7 @@ then
fi

# Check that a signer is specified
if [[ $SIGNER == "" ]]
if [[ "$SIGNER" == "" ]]
then
echo "$scriptName: Missing signer."
echo "Try $scriptName --help for more information"
Expand Down Expand Up @@ -240,6 +257,10 @@ then
then
sudo apt-get install 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
bin/make-base-vm --suite trusty --arch amd64
fi
Expand Down Expand Up @@ -275,7 +296,7 @@ then
echo "Compiling ${VERSION} Linux"
echo ""
./bin/gbuild -j ${proc} -m ${mem} --commit dash=${COMMIT} --url dash=${url} ../dash/contrib/gitian-descriptors/gitian-linux.yml
./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-linux.yml
./bin/gsign -p "$signProg" --signer "$SIGNER" --release ${VERSION}-linux --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-linux.yml
mv build/out/dash-*.tar.gz build/out/src/dash-*.tar.gz ../dash-binaries/${VERSION}
fi
# Windows
Expand All @@ -285,7 +306,7 @@ then
echo "Compiling ${VERSION} Windows"
echo ""
./bin/gbuild -j ${proc} -m ${mem} --commit dash=${COMMIT} --url dash=${url} ../dash/contrib/gitian-descriptors/gitian-win.yml
./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-win.yml
./bin/gsign -p "$signProg" --signer "$SIGNER" --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-win.yml
mv build/out/dash-*-win-unsigned.tar.gz inputs/dash-win-unsigned.tar.gz
mv build/out/dash-*.zip build/out/dash-*.exe ../dash-binaries/${VERSION}
fi
Expand All @@ -296,7 +317,7 @@ then
echo "Compiling ${VERSION} Mac OSX"
echo ""
./bin/gbuild -j ${proc} -m ${mem} --commit dash=${COMMIT} --url dash=${url} ../dash/contrib/gitian-descriptors/gitian-osx.yml
./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-osx.yml
./bin/gsign -p "$signProg" --signer "$SIGNER" --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-osx.yml
mv build/out/dash-*-osx-unsigned.tar.gz inputs/dash-osx-unsigned.tar.gz
mv build/out/dash-*.tar.gz build/out/dash-*.dmg ../dash-binaries/${VERSION}
fi
Expand All @@ -309,9 +330,9 @@ then
echo "Committing ${VERSION} Unsigned Sigs"
echo ""
pushd gitian.sigs
git add ${VERSION}-linux/${SIGNER}
git add ${VERSION}-win-unsigned/${SIGNER}
git add ${VERSION}-osx-unsigned/${SIGNER}
git add ${VERSION}-linux/"${SIGNER}"
git add ${VERSION}-win-unsigned/"${SIGNER}"
git add ${VERSION}-osx-unsigned/"${SIGNER}"
git commit -a -m "Add ${VERSION} unsigned sigs for ${SIGNER}"
popd
fi
Expand Down Expand Up @@ -361,7 +382,7 @@ then
echo "Signing ${VERSION} Windows"
echo ""
./bin/gbuild -i --commit signature=${COMMIT} ../dash/contrib/gitian-descriptors/gitian-win-signer.yml
./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-win-signed --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-win-signer.yml
./bin/gsign -p "$signProg" --signer "$SIGNER" --release ${VERSION}-win-signed --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-win-signer.yml
mv build/out/dash-*win64-setup.exe ../dash-binaries/${VERSION}
mv build/out/dash-*win32-setup.exe ../dash-binaries/${VERSION}
fi
Expand All @@ -372,7 +393,7 @@ then
echo "Signing ${VERSION} Mac OSX"
echo ""
./bin/gbuild -i --commit signature=${COMMIT} ../dash/contrib/gitian-descriptors/gitian-osx-signer.yml
./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-osx-signed --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-osx-signer.yml
./bin/gsign -p "$signProg" --signer "$SIGNER" --release ${VERSION}-osx-signed --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-osx-signer.yml
mv build/out/dash-osx-signed.dmg ../dash-binaries/${VERSION}/dash-${VERSION}-osx.dmg
fi
popd
Expand All @@ -384,8 +405,8 @@ then
echo ""
echo "Committing ${VERSION} Signed Sigs"
echo ""
git add ${VERSION}-win-signed/${SIGNER}
git add ${VERSION}-osx-signed/${SIGNER}
git add ${VERSION}-win-signed/"${SIGNER}"
git add ${VERSION}-osx-signed/"${SIGNER}"
git commit -a -m "Add ${VERSION} signed binary sigs for ${SIGNER}"
popd
fi
Expand Down