diff --git a/.travis.yml b/.travis.yml index 2158be8ef8e..5bd8c8f4485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,12 @@ language: bash -dist: trusty -sudo: required - git: depth: 200 env: global: - - PATH=$PATH:$HOME/bin + - PATH=$PATH:/tmp/bin + - TAG=2019032901 matrix: - XLINT=1 @@ -20,19 +18,22 @@ env: - ARCH=armv6l-musl BOOTSTRAP=x86_64-musl - ARCH=aarch64-musl BOOTSTRAP=x86_64-musl +install: + - common/travis/docker.sh + before_script: - common/travis/set_mirror.sh - common/travis/prepare.sh - common/travis/fetch_upstream.sh - common/travis/changed_templates.sh + - common/travis/fetch-xtools.sh - common/travis/xlint.sh - - common/travis/bootstrap.sh $BOOTSTRAP script: - - common/travis/build.sh $BOOTSTRAP $ARCH + - if [ -z "$XLINT" ]; then docker exec -t void hostrepo/common/travis/build.sh $BOOTSTRAP $ARCH; fi after_script: - - common/travis/show_files.sh $BOOTSTRAP $ARCH + - if [ -z "$XLINT" ]; then docker exec -t void hostrepo/common/travis/show_files.sh $BOOTSTRAP $ARCH; fi notifications: email: false diff --git a/common/travis/bootstrap.sh b/common/travis/bootstrap.sh deleted file mode 100755 index 755f70c2720..00000000000 --- a/common/travis/bootstrap.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# bootstrap.sh - -[ "$XLINT" ] && exit 0 - -./xbps-src -H $HOME/hostdir binary-bootstrap $1 diff --git a/common/travis/build.sh b/common/travis/build.sh index bf5b437367e..c388af06841 100755 --- a/common/travis/build.sh +++ b/common/travis/build.sh @@ -2,16 +2,20 @@ # # build.sh -[ "$XLINT" ] && exit 0 - if [ "$1" != "$2" ]; then arch="-a $2" fi -PKGS=$(./xbps-src sort-dependencies $(cat /tmp/templates)) +# Tell xbps-src what is our arch, this is done when doing +# binary-bootstrap, but we need to do it every time since +# our masterdir is ethereal. +/bin/echo -e '\x1b[32mWriting bootstrap arch into .xbps_chroot_init of masterdir\x1b[0m' +echo "$1" > /hostrepo/masterdir/.xbps_chroot_init + +PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates)) for pkg in ${PKGS}; do - ./xbps-src -H $HOME/hostdir $arch pkg "$pkg" + /hostrepo/xbps-src -H "$HOME"/hostdir $arch pkg "$pkg" [ $? -eq 1 ] && exit 1 done diff --git a/common/travis/docker.sh b/common/travis/docker.sh new file mode 100755 index 00000000000..1784cd4a54e --- /dev/null +++ b/common/travis/docker.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# docker.sh + +[ "$XLINT" ] && exit 0 + +/bin/echo -e "\x1b[32mPulling docker image for $BOOTSTRAP from $TAG...\x1b[0m" +docker pull voidlinux/masterdir-$BOOTSTRAP:$TAG +docker run -d \ + --name void \ + -v "$(pwd)":/hostrepo \ + -v /tmp:/tmp \ + -e XLINT="$XLINT" \ + -e PATH="$PATH" \ + voidlinux/masterdir-$BOOTSTRAP:$TAG \ + /bin/sh -c 'sleep inf' diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh new file mode 100755 index 00000000000..ff39922cf86 --- /dev/null +++ b/common/travis/fetch-xtools.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# fetch-xtools.sh + +mkdir -p /tmp/bin + +/bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m' +wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \ + gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \ + --strip-components=1 || exit 1 diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh index 2e44dd3d5be..869cc4b72d1 100755 --- a/common/travis/prepare.sh +++ b/common/travis/prepare.sh @@ -2,22 +2,16 @@ # # install_tools.sh -mkdir -p $HOME/bin - -/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m' -wget -q -O - http://alpha.de.repo.voidlinux.org/static/xbps-static-latest.x86_64-musl.tar.xz | \ - unxz | tar x -C $HOME/bin --wildcards "./usr/bin/xbps-*" \ - --strip-components=3 || exit 1 - -sudo chown root $HOME/bin/xbps-uchroot -sudo chmod u+s $HOME/bin/xbps-uchroot - -/bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m' -wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \ - gunzip | tar x -C $HOME/bin --wildcards "xtools-master/x*" \ - --strip-components=1 || exit 1 +[ "$XLINT" ] && exit 0 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m' echo XBPS_CHROOT_CMD=uchroot >> etc/conf echo XBPS_MAKEJOBS=4 >> etc/conf echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf + +/bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m' +echo XBPS_CHROOT_CMD=ethereal >> etc/conf +echo XBPS_ALLOW_CHROOT_BREAKOUT=yes >> etc/conf + +/bin/echo -e '\x1b[32mLinking / to /masterdir...\x1b[0m' +ln -s / masterdir diff --git a/common/travis/set_mirror.sh b/common/travis/set_mirror.sh index 74627f4da2e..8e5353f55d8 100755 --- a/common/travis/set_mirror.sh +++ b/common/travis/set_mirror.sh @@ -4,7 +4,7 @@ TRAVIS_PROTO=http TRAVIS_MIRROR=alpha.us.repo.voidlinux.org for _i in etc/repos-remote.conf etc/defaults.conf etc/repos-remote-x86_64.conf ; do - printf '\x1b[32mUpdating %s...\x1b[0m\n' $_i + /bin/echo -e "\x1b[32mUpdating $_i...\x1b[0m" # First fix the proto, ideally we'd serve everything with HTTPS, # but key management and rotation is a pain, and things are signed # so we can afford to be a little lazy at times. diff --git a/common/travis/show_files.sh b/common/travis/show_files.sh index fcc99a6ae28..e5029bd0ca3 100755 --- a/common/travis/show_files.sh +++ b/common/travis/show_files.sh @@ -2,9 +2,7 @@ # # show_files.sh -[ "$XLINT" ] && exit 0 - -export XBPS_TARGET_ARCH="$2" +export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo for pkg in $(cat /tmp/templates); do for subpkg in $(xsubpkg $pkg); do diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh index 2d5a71b71be..56714bcd3a2 100755 --- a/common/travis/xlint.sh +++ b/common/travis/xlint.sh @@ -4,4 +4,7 @@ [ "$XLINT" ] || exit 0 -awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | xargs xlint +awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | while read -r t; do + /bin/echo -e "\x1b[32mLinting $t...\x1b[0m" + xlint "$t" +done