From 67315be67392e9f104973c66752da08e0898af0f Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 27 Apr 2017 20:09:12 +0200 Subject: [PATCH] travis: Simplified build script The Dockerfile is now stored in contrib and built using the Docker Hub. This allows us to simply pull in the finished image from the hub instead of having to build it ourself. Should shave off about 2 minutes from the build time. I also switched to running the individual build and check steps in their own containers, but on the same volume, so travis can group the commands and run them independently. --- .travis.yml | 4 +++- Makefile | 2 +- contrib/Dockerfile.builder | 27 +++++++++++++++++++++++++++ tools/travis.sh | 32 -------------------------------- 4 files changed, 31 insertions(+), 34 deletions(-) create mode 100644 contrib/Dockerfile.builder delete mode 100755 tools/travis.sh diff --git a/.travis.yml b/.travis.yml index 451dff537..acf247e1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,6 @@ sudo: true # Trusty (aka 14.04) is way way too old, so run in docker... script: - - tools/travis.sh + - docker run --rm=true -v "${TRAVIS_BUILD_DIR}":/build -t cdecker/lightning-ci make -j3 + - docker run --rm=true -v "${TRAVIS_BUILD_DIR}":/build -t cdecker/lightning-ci make check + - docker run --rm=true -v "${TRAVIS_BUILD_DIR}":/build -t cdecker/lightning-ci make check-source diff --git a/Makefile b/Makefile index 69440b5dc..df697cbe9 100644 --- a/Makefile +++ b/Makefile @@ -285,7 +285,7 @@ check-source: check-makefile check-source-bolt check-whitespace \ $(CORE_TX_HEADERS:%=check-hdr-include-order/%) \ $(BITCOIN_HEADERS:%=check-hdr-include-order/%) -full-check: check pytest $(TEST_PROGRAMS) check-source +full-check: check $(TEST_PROGRAMS) check-source coverage/coverage.info: check $(TEST_PROGRAMS) pytest mkdir coverage || true diff --git a/contrib/Dockerfile.builder b/contrib/Dockerfile.builder new file mode 100644 index 000000000..66042b45c --- /dev/null +++ b/contrib/Dockerfile.builder @@ -0,0 +1,27 @@ +FROM ubuntu:16.04 + +ENV DEBIAN_FRONTEND noninteractive +WORKDIR /build + +RUN echo "deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/bitcoin.list +RUN apt-get -qq update && \ + apt-get -qq install --allow-unauthenticated -yy \ + eatmydata \ + software-properties-common \ + build-essential \ + autoconf \ + libtool \ + libprotobuf-c-dev \ + libsqlite3-dev \ + libgmp-dev \ + libsqlite3-dev \ + git \ + python \ + python3 \ + valgrind \ + net-tools \ + bitcoind \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install python-bitcoinlib==0.7.0 diff --git a/tools/travis.sh b/tools/travis.sh deleted file mode 100755 index 91cb3289f..000000000 --- a/tools/travis.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# This build script is for running the Travis builds using docker. -# Stolen from: https://github.com/shenki/openbmc-build-scripts/blob/master/linux-openbmc-build.sh - -# Trace bash processing -set -ex - -# Build the docker container -docker build -t ubuntu - <