diff options
| author | Maxime Dénès | 2017-03-13 11:33:48 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2017-03-13 11:33:48 +0100 |
| commit | ecacc9af6100f76e95acc24e777026bfc9c4d921 (patch) | |
| tree | 4c319de83cb07833fb253b2c3cd68d8a882c639b /dev/ci/ci-common.sh | |
| parent | e2135c2f5fd8846c30d8099eed523fe06202b614 (diff) | |
| parent | fd5c5da475baea11d7ee2e1c2e965d7faeed3f33 (diff) | |
Merge PR#456: Proposing improvement to the CI targets for local use
Diffstat (limited to 'dev/ci/ci-common.sh')
| -rw-r--r-- | dev/ci/ci-common.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/dev/ci/ci-common.sh b/dev/ci/ci-common.sh index 412da626fd..6f624ab6ec 100644 --- a/dev/ci/ci-common.sh +++ b/dev/ci/ci-common.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xe @@ -8,20 +8,30 @@ export PATH=`pwd`/bin:$PATH ls `pwd`/bin +# Where we clone and build external developments +CI_BUILD_DIR=`pwd`/_build_ci + # Maybe we should just use Ruby... mathcomp_CI_BRANCH=master mathcomp_CI_GITURL=https://github.com/math-comp/math-comp.git +mathcomp_CI_DIR=${CI_BUILD_DIR}/math-comp -# git_checkout branch +# git_checkout branch url dest will create a git repository +# in <dest> (if it does not exist already) and checkout the +# remote branch <branch> from <url> git_checkout() { local _BRANCH=${1} local _URL=${2} local _DEST=${3} - echo "Checking out ${_DEST}" - git clone --depth 1 -b ${_BRANCH} ${_URL} ${_DEST} - ( cd ${3} && echo "${_DEST}: `git log -1 --format='%s | %H | %cd | %aN'`" ) + mkdir -p ${_DEST} + ( cd ${_DEST} && \ + if [ ! -d .git ] ; then git clone --depth 1 ${_URL} . ; fi && \ + echo "Checking out ${_DEST}" && \ + git fetch ${_URL} ${_BRANCH} && \ + git checkout FETCH_HEAD && \ + echo "${_DEST}: `git log -1 --format='%s | %H | %cd | %aN'`" ) } checkout_mathcomp() @@ -34,8 +44,8 @@ install_ssreflect() { echo 'Installing ssreflect' && echo -en 'travis_fold:start:ssr.install\\r' - checkout_mathcomp math-comp - ( cd math-comp/mathcomp && \ + checkout_mathcomp ${mathcomp_CI_DIR} + ( cd ${mathcomp_CI_DIR}/mathcomp && \ sed -i.bak '/ssrtest/d' Make && \ sed -i.bak '/odd_order/d' Make && \ sed -i.bak '/all\/all.v/d' Make && \ |
