[beast] TRAVIS: add 'distcheck' to build matrix
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast] TRAVIS: add 'distcheck' to build matrix
- Date: Fri, 1 Apr 2016 08:50:27 +0000 (UTC)
commit d84010890e81ce5861d0b91006e4c1e8eadd2cda
Author: Tim Janik <timj gnu org>
Date: Thu Mar 31 19:19:20 2016 +0200
TRAVIS: add 'distcheck' to build matrix
Signed-off-by: Tim Janik <timj gnu org>
.travis.docker | 33 ++++++++++++++++++++++++---------
.travis.yml | 48 +++++++++++++++++++++++-------------------------
2 files changed, 47 insertions(+), 34 deletions(-)
---
diff --git a/.travis.docker b/.travis.docker
index 265afb8..0fbf9ec 100644
--- a/.travis.docker
+++ b/.travis.docker
@@ -1,14 +1,18 @@
# This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
# Pick distribution to start from
-FROM @XFROM@
+FROM @DIST@
MAINTAINER Tim Janik <timj gnu org>
# Carry over enviroment variables
ENV EMAIL beast gnome org
+ENV DIST "@DIST@"
+ENV DISTNAME "@DISTNAME@"
+ENV DISTRELEASE "@DISTRELEASE@"
+ENV BINTRAYREPO "@BINTRAYREPO@"
ENV TRAVIS_JOB_NUMBER "@TRAVIS_JOB_NUMBER@"
ENV http_proxy "@http_proxy@"
-ENV BINTRAYREPO "@BINTRAYREPO@"
+ENV INTENT "@INTENT@"
# Automation tools and convenience commands
ENV DEBIAN_FRONTEND noninteractive
@@ -19,8 +23,9 @@ RUN echo '#!/bin/bash\n"$@" || { sleep 5 ; "$@" ; } || { sleep 60 ; "$@" ; }' >
'\nfunction regrep { (shopt -s globstar extglob; IFS=; set - ; /usr/bin/nice /bin/egrep --color=auto -d
skip "") }' \
| tee -a /etc/bash.bashrc >> /root/.bashrc
-# Ensure uptodate distribution
-RUN retry apt-get update && retry apt-get -y install apt-utils && retry apt-get -y upgrade
+# Ensure uptodate distribution and access to the bintray.com repositories
+RUN retry apt-get update && retry apt-get -y install apt-utils && retry apt-get -y upgrade && \
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61
# Install Rapicorn packages
RUN echo 'deb [trusted=yes] @BINTRAYREPO@' | \
@@ -45,6 +50,7 @@ COPY .git /tmp/beast.git
RUN git clone /tmp/beast.git
# Build sources, run tests and create distribution tarball
+# Carry out distcheck test if desired
RUN cd beast && \
nice ./autogen.sh --prefix=/usr --enable-devel-mode=no && \
nice make -j4 && \
@@ -53,23 +59,32 @@ RUN cd beast && \
nice make installcheck && \
nice make dist && \
nice make uninstall && \
+ ( [ $INTENT = distcheck ] || exit 0 && \
+ nice make distcheck ) && \
nice make clean && \
DIST_TARBALL=`echo *.tar.xz` && \
ls -l "$DIST_TARBALL"
-# Create packages as follows:
+# Create deb packages as follows:
# Eval configuration, prepare debian source tarball, prepare debian/ directory,
# update 'changelog', install dependencies, build debian packages.
-RUN eval `beast/buildtool.sh config` && \
- DIST_TARBALL="$PACKAGE/$PACKAGE-$VERSION.tar.xz" && \
- DEBVERSION="$VERSION$VCSREVISION" && \
+RUN [ $INTENT = deb ] || exit 0 && \
+ eval `beast/buildtool.sh config` && \
+ DIST_TARBALL="$PACKAGE/$PACKAGE-$UPSVERSION.tar.xz" && \
DEB_TARBALL="$PACKAGE"_"${DEBVERSION%-*}.orig.tar.xz" && \
cp $DIST_TARBALL $DEB_TARBALL && tar xf $DEB_TARBALL && \
- cd $PACKAGE-$VERSION/ && cp -r ../$PACKAGE/debian/ . && \
+ cd $PACKAGE-$UPSVERSION/ && cp -r ../$PACKAGE/debian/ . && \
dch -v "$DEBVERSION" "$CHANGELOGMSG" && dch -r "" && cat debian/changelog && \
retry apt-get -y install $(dpkg-checkbuilddeps 2>&1 | sed 's/.*: //') && \
nice debuild -j`nproc` -rfakeroot -us -uc && \
cd .. && ls -al
+# Test package installation and removal locally
+RUN [ $INTENT = deb ] || exit 0 && \
+ dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz && \
+ echo 'deb [trusted=yes] file:///usr/src ./' > /etc/apt/sources.list.d/usrsrc.list && \
+ retry apt-get update && apt-get install -y beast libbse-dev && \
+ apt-get purge -y beast libbse-dev && apt-get --purge -y autoremove
+
# nice -n19 docker build -t beast .
# docker run -ti --rm beast /bin/bash
diff --git a/.travis.yml b/.travis.yml
index 107632a..2fbc858 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,21 +12,28 @@ language: c
env:
global:
#- http_proxy="http://example.com"
- - bintray_url="https://dl.bintray.com/beast-team"
+ - INTENT="deb" # build and upload deb packages
matrix:
- - XFROM="debian:jessie" XUP="jessie"
- - XFROM="debian:testing" XUP="testing"
- - XFROM="ubuntu:trusty" XUP="trusty"
- - XFROM="ubuntu:wily" XUP="wily"
- - XFROM="ubuntu:xenial" XUP="xenial"
+ # Distribution Name and Version
+ - DIST="debian:jessie"
+ - DIST="debian:testing"
+ - DIST="ubuntu:trusty"
+ - DIST="ubuntu:wily"
+ - DIST="ubuntu:xenial"
+ - INTENT="distcheck" DIST="ubuntu:wily" # run and succeed in 'distcheck'
matrix:
- fast_finish: true
allow_failures:
- - env: XFROM="debian:testing" XUP="testing"
- - env: XFROM="ubuntu:trusty" XUP="trusty"
- - env: XFROM="ubuntu:xenial" XUP="xenial"
+ - env: DIST="debian:testing"
+ - env: DIST="ubuntu:trusty"
+ - env: DIST="ubuntu:xenial"
+ fast_finish: true
before_install:
+ # Build variable setup
+ - export DISTNAME="${DIST%:*}" DISTRELEASE="${DIST#*:}" # Example: DIST=debian:jessie DISTNAME=debian
DISTRELEASE=jessie
+ - export BINTRAYREPO="deb [trusted=yes] https://dl.bintray.com/beast-team/deb $DISTRELEASE main"
+ - echo "DIST=$DIST DISTNAME=$DISTNAME DISTRELEASE=$DISTRELEASE BINTRAYREPO='$BINTRAYREPO'"
+ # Sample environment
- uname -a
- cat /etc/os-release
- pwd
@@ -36,31 +43,22 @@ before_install:
- $CC --version
install:
- # Complete history is required for VCSREVISION
+ # Complete history is required for monotonic revisioning
- travis_retry git fetch --unshallow
- # Point BINTRAYREPO at the beast-time package repository
- - export BINTRAYREPO="$bintray_url/$XUP snapshot main"
# Configure Dockerfile by substituting @VAR@ with $VAR
- ./buildtool.sh applyenv .travis.docker > Dockerfile
# Build and run tests, create packages
- docker build -t beast .
- # Test package installation and removal locally
- - docker run -ti --rm beast /bin/bash -c
- "set -x && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz &&
- echo 'deb [trusted=yes] file:///usr/src ./' > /etc/apt/sources.list.d/usrsrc.list &&
- retry apt-get update && apt-get install -y beast libbse-dev &&
- apt-get purge -y beast libbse-dev && apt-get --purge -y autoremove"
script:
# Upload packages
- - test -z "$XUP" || docker run -ti --rm beast /bin/bash -c
- "export BINTRAY_APITOKEN=$BINTRAY_APITOKEN && ls -al && beast/buildtool.sh bintrayup beast-team
$XUP/beast snapshot *.deb"
+ - ([ $INTENT = deb ] || exit 0 && docker run -ti --rm beast /bin/bash -c \
+ "export BINTRAY_APITOKEN=$BINTRAY_APITOKEN && ls -al && beast/buildtool.sh bintrayup beast-team
deb/beast $DISTRELEASE *.deb")
# Test package installation from remote location
- - docker run -ti --rm beast /bin/bash -c \
+ - ([ $INTENT = deb ] || exit 0 && sleep 60 && travis_retry docker run -ti --rm beast /bin/bash -c \
"set -x && retry apt-get -y install apt-transport-https ca-certificates &&
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61 &&
- echo 'deb [trusted=yes] $BINTRAYREPO' | tee /etc/apt/sources.list.d/bintray-beast-team.list &&
- retry apt-get update && retry apt-get -y install beast libbse-dev"
+ echo '$BINTRAYREPO' | tee /etc/apt/sources.list.d/bintray-beast-team.list &&
+ retry apt-get update && retry apt-get -y install beast libbse-dev")
- docker ps -a
after_success:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]