From 56dc3e331c6b4b2bfa5ac072db57db8250884ce3 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Tue, 7 Mar 2017 12:33:37 +0100 Subject: Improve build of travis target on local machine. - Move the git clones to a specific subfolder to avoid pollution. - Do not fail when git clone already exist (but make sure it is up-to-date). --- .gitignore | 1 + dev/ci/ci-common.sh | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 35cdf9b4e..64c49b008 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ TAGS .DS_Store .pc bin/ +_build_ci _build myocamlbuild_config.ml config/Makefile diff --git a/dev/ci/ci-common.sh b/dev/ci/ci-common.sh index 412da626f..cc34bc295 100644 --- a/dev/ci/ci-common.sh +++ b/dev/ci/ci-common.sh @@ -12,6 +12,9 @@ ls `pwd`/bin mathcomp_CI_BRANCH=master mathcomp_CI_GITURL=https://github.com/math-comp/math-comp.git +# Where we clone and build external developments +CI_BUILD_DIR=`pwd`/_build_ci + # git_checkout branch git_checkout() { @@ -19,9 +22,15 @@ git_checkout() 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 ${CI_BUILD_DIR} + cd ${CI_BUILD_DIR} + + if [ ! -d ${_DEST} ] ; then + echo "Checking out ${_DEST}" + git clone --depth 1 -b ${_BRANCH} ${_URL} ${_DEST} + fi + ( cd ${_DEST} && git pull && + echo "${_DEST}: `git log -1 --format='%s | %H | %cd | %aN'`" ) } checkout_mathcomp() -- cgit v1.2.3