diff --git a/.travis.yml b/.travis.yml index b65264ff9..c77ac6657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,45 @@ language: bash -sudo: false +sudo: required -addons: - apt: - sources: - - debian-sid - packages: - - shellcheck +before_script: + - sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static + - echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | sudo tee -a /proc/sys/fs/binfmt_misc/register + # Install shellcheck. Workaround for this issue: https://github.com/travis-ci/travis-ci/issues/8823 + - curl -sSL "https://ftp-master.debian.org/keys/archive-key-7.0.asc" | sudo -E apt-key add - + - echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list > /dev/null + - sudo apt-get update + - sudo apt-get install -y shellcheck + +services: + - docker + +env: + - ARCH=arm BOARD=pi + - ARCH=arm BOARD=sparky + - ARCH=arm BOARD=bbb + - ARCH=arm BOARD=bpim2u + - ARCH=armv7 BOARD=cuboxi + - ARCH=armv7 BOARD=odroidc1 + - ARCH=armv7 BOARD=odroidc2 + - ARCH=armv7 BOARD=odroidxu4 + - ARCH=armv7 BOARD=odroidx2 + - ARCH=armv7 BOARD=udooneo + - ARCH=armv7 BOARD=udooqdl + - ARCH=armv7 BOARD=pine64 + - ARCH=armv7 BOARD=nanopi64 + - ARCH=armv7 BOARD=bpipro + - ARCH=armv7 BOARD=tinkerboard + - ARCH=armv7 BOARD=sopine64 + - ARCH=armv7 BOARD=rock64 + - ARCH=armv7 BOARD=voltastream0 + - ARCH=armv7 BOARD=nanopineo + - ARCH=armv7 BOARD=nanopineo2 + - ARCH=x86 BOARD=x86 script: - find . -iname "*.sh" -exec shellcheck "{}" \; + - ./docker-build.sh -b ${ARCH} -d ${BOARD} -v 2.$(git rev-list HEAD --count) matrix: fast_finish: true diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 000000000..45239fd02 --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Docker based image builder +# +# This is an alternative method for building a volumio image that does not +# require the user to have a debian system with specific packages versions. +# +# This method relies on a pre-built docker container that will perform the +# whole build process and generate the required image in the local directory. + +DOCKER="docker" + +DPATH=$(which "${DOCKER}" 2> /dev/null) +FOUND=$? +RUNDATE=$(date "+%Y-%m-%d") + +if [ "${FOUND}" != "0" ]; then + echo "You need to have ${DOCKER} installed to be able to perform a Docker based build" + exit 1 +fi + +if [ $# -lt 2 ]; then + echo "Missign build parameters!" + echo + echo "This script is a wrapper around the main ./build.sh script, and as such it requires specific parameters" + echo "to be passed over to build.sh." + echo + echo "Please run the command ./build.sh without parameters for a full help." + exit 2 +fi + +${DOCKER} run -it --rm --name=volumio-build --privileged \ + -v ${PWD}:/build piffio/volumio-build \ + $@ | tee docker-build-${RUNDATE}.log