Fixes to integrate with new bitcoin core dependency management & cache

This commit is contained in:
gdm85 2014-12-31 11:20:00 +01:00
parent 5407f858d4
commit a660cb4367
4 changed files with 53 additions and 31 deletions

View File

@ -7,6 +7,8 @@ FROM gdm85/gitian-host-vms
MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com" MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com"
RUN aptitude install make -y
COPY input-sources/ /home/debian/input-sources/ COPY input-sources/ /home/debian/input-sources/
COPY bin/build-bitcoin.sh /home/debian/ COPY bin/build-bitcoin.sh /home/debian/
COPY bin/sign.sh /home/debian/ COPY bin/sign.sh /home/debian/

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
## automatic Gitian build of bitcoin ## automatic Gitian build of bitcoin
## @author gdm85 ## @author gdm85
## @version 0.3.0 ## @version 0.3.1
## see also https://github.com/gdm85/tenku/blob/master/docker/gitian-bitcoin-host/ ## see also https://github.com/gdm85/tenku/blob/master/docker/gitian-bitcoin-host/
## ##
# #
@ -13,33 +13,54 @@ fi
VERSION="$1" VERSION="$1"
CLONE="$HOME/bitcoin"
function verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
cd gitian-builder && \
mkdir -p inputs && \
cd .. || exit $?
if [ ! -d bitcoin ]; then if [ ! -d bitcoin ]; then
git clone https://github.com/bitcoin/bitcoin.git || exit $? git clone https://github.com/bitcoin/bitcoin.git && \
cd bitcoin && \
git checkout v$VERSION && \
cd .. || exit $?
fi fi
cd bitcoin && \
git checkout v${VERSION} && \
cd ../gitian-builder && \
mkdir -p inputs && cd inputs/ || exit $?
## get each dependency ## old logic using descriptors
## they are validated afterwards by gbuild if ! verlte 0.10.0rc1 ${VERSION}; then
while read -r URL FNAME; do cd gitian-builder/inputs || exit $?
if [ -z "$URL" ]; then ## get each dependency
continue ## they are validated afterwards by gbuild
fi while read -r URL FNAME; do
if [ ! -f $FNAME ]; then if [ -z "$URL" ]; then
echo "echo 'Downloading $FNAME'" continue
echo "wget -q --no-check-certificate '$URL' -O '$FNAME' || echo 'Failed to download $FNAME from $URL'" fi
fi if [ ! -f $FNAME ]; then
done < ../../input-sources/${VERSION}-inputs.txt | parallel -j10 || exit $? echo "echo 'Downloading $FNAME'"
echo "wget -q --no-check-certificate '$URL' -O '$FNAME' || echo 'Failed to download $FNAME from $URL'"
fi
done < ../../input-sources/${VERSION}-inputs.txt | parallel -j10 || exit $?
## verify that all sources are correct before continuing ## verify that all sources are correct before continuing
md5sum -c < ../../input-sources/${VERSION}-inputs.md5 && \ md5sum -c < ../../input-sources/${VERSION}-inputs.md5 && \
cd .. && \ DESCRIPTORS="$(<../input-sources/${VERSION}-descriptors.txt)" && \
for DESC in $(<../input-sources/${VERSION}-descriptors.txt); do cd .. || exit $?
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/${DESC}.yml && \
mv -v $(find build/out -type f -name '*gz' -o -name '*.zip') inputs/ || exit $? for DESC in $DESCRIPTORS; do
done && \ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/${DESC}.yml && \
./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml && \ mv -v $(find build/out -type f -name '*gz' -o -name '*.zip') inputs/ || exit $?
echo "Completed successfully." && \ done
echo "The output files are in: gitian-builder/build/out/" else
cd bitcoin/depends && \
make download-linux SOURCES_PATH="$HOME/gitian-builder/cache/common" && \
cd ../.. || exit $?
fi
## proceed to build
cd gitian-builder && \
./bin/gbuild -u bitcoin=$CLONE $CLONE/contrib/gitian-descriptors/gitian-linux.yml && \
echo "Build completed successfully, output files are in: ~/gitian-builder/build/out/"

View File

@ -1,5 +1,4 @@
-#!/bin/bash #!/bin/bash
set -e
if [[ ! $# -eq 2 ]]; then if [[ ! $# -eq 2 ]]; then
echo "Please specify version and signer id" 1>&2 echo "Please specify version and signer id" 1>&2
@ -9,5 +8,5 @@ fi
VERSION="$1" VERSION="$1"
SIGNER="$2" SIGNER="$2"
cd gitian-builder cd gitian-builder && \
./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml ./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml

View File

@ -56,7 +56,7 @@ COPY bash_profile /home/debian/.bash_profile
## script used to build base VMs ## script used to build base VMs
COPY bin/build-base-vms.sh /home/debian/ COPY bin/build-base-vms.sh /home/debian/
RUN git clone https://github.com/devrandom/gitian-builder.git && cd gitian-builder && git checkout ffd04a46a2b3c1277937c939cdb151fcf0eac613 RUN git clone https://github.com/devrandom/gitian-builder.git && cd gitian-builder && git checkout 2bcc06e6b75b3f7a0167cde7237331757dd559c6
COPY gitian.patch /home/debian/ COPY gitian.patch /home/debian/