From 2db31d95fdd62ad0bf9ca02848527201f199b466 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 11 Sep 2016 20:28:01 +0100 Subject: [PATCH] Use "phase" script for travis build phases. This is the first step towards unifying travis configs for toxcore, hstox, and qtox. --- .travis.yml | 14 +++++++------- other/travis/phase | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100755 other/travis/phase diff --git a/.travis.yml b/.travis.yml index d25afd13fb..2f22d49515 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,14 @@ language: c matrix: include: - - env: BUILD=hstox ENV=linux + - env: JOB=hstox ENV=linux language: haskell ghc: 7.8 - - env: BUILD=toxcore ENV=linux + - env: JOB=toxcore ENV=linux compiler: clang - - env: BUILD=toxcore ENV=linux + - env: JOB=toxcore ENV=linux compiler: gcc - - env: BUILD=autotools ENV=linux + - env: JOB=autotools ENV=linux compiler: clang addons: @@ -38,9 +38,9 @@ cache: - $HOME/.ghc - $HOME/cache -install: other/travis/${BUILD}-install -script: other/travis/${BUILD}-script -after_script: other/travis/${BUILD}-after_script +install: other/travis/phase $JOB $ENV install +script: other/travis/phase $JOB $ENV script +after_script: other/travis/phase $JOB $ENV after_script notifications: irc: "chat.freenode.net#toktok-status" diff --git a/other/travis/phase b/other/travis/phase new file mode 100755 index 0000000000..ac9bc3b428 --- /dev/null +++ b/other/travis/phase @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e -u -x + +JOB="$1" +ENV="$2" +PHASE="$3" + +. "other/travis/env.sh" +. "other/travis/env-$ENV.sh" + +try_source() { + SCRIPT="other/travis/$1" + if [ -f "$SCRIPT" ]; then + . "$SCRIPT" + fi +} + +try_source "$PHASE" +try_source "$ENV-$PHASE" +try_source "$JOB-$PHASE" +try_source "$JOB-$ENV-$PHASE"