diff --git a/.travis.yml b/.travis.yml index a4b6eac35..65eb574b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,16 +18,12 @@ cache: directories: - $HOME/repo.cache -git: - lfs_skip_smudge: true #====================================================================== #====================================================================== before_install: - | # setup the configurables that the subsequent scripts use - - # see .travis/prep.sh for a full description of these env vars export BUNDLE_URL="https://github.com/JCSDA/soca-bundle.git" export MAIN_REPO=soca export MAIN_BUILD_TYPE=${BUILD_TYPE} @@ -37,9 +33,9 @@ before_install: export LIB_BUILD_OPT_OOPS="-DENABLE_OOPS_TOYMODELS=OFF" export MATCH_REPOS="saber oops ioda ioda-converters ufo soca soca-config" export LFS_REPOS="soca" - export BRANCH=$( [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && \ echo $TRAVIS_BRANCH || echo $TRAVIS_PULL_REQUEST_BRANCH ) + export_vars="-e REPO_CACHE=/repo.cache -e LIB_REPOS -e LIB_BUILD_TYPE -e MAIN_REPO -e MAIN_BUILD_TYPE -e CCACHE_DIR=/ccache -e LIB_BUILD_OPT_OOPS" @@ -49,6 +45,7 @@ before_install: WORK_DIR=$HOME/work mkdir -p $WORK_DIR; cd $WORK_DIR REPO_CACHE=$HOME/repo.cache ${TRAVIS_BUILD_DIR}/.travis/prep.sh + mv ${TRAVIS_BUILD_DIR} ${WORK_DIR}/repo.src/ - | # alter file permissions @@ -58,7 +55,7 @@ before_install: - | # prepare docker image from jcsda/docker:latest - cd ${TRAVIS_BUILD_DIR}/.travis + cd ${WORK_DIR}/repo.src/${MAIN_REPO}/.travis docker build -t jcsda/dockerl2 --build-arg=Dockerfile . docker images ci_env=`bash <(curl -s https://codecov.io/env)` diff --git a/.travis/prep.sh b/.travis/prep.sh index e5f4764ad..cb59bfbbe 100755 --- a/.travis/prep.sh +++ b/.travis/prep.sh @@ -29,6 +29,10 @@ for repo in $LIB_REPOS $MAIN_REPO; do fi done + # if this is the main test repo, don't download, assume + # it has already been downloaded by TravisCI + [[ $repo == $MAIN_REPO ]] && continue + # determine the branch / git hash tag, based on the branch name in the original bundle repo_url=$(grep "PROJECT $repo" $repo_bundle_dir/CMakeLists.txt | awk '{print $5}' | sed 's|"||g') repo_branch=$(grep "PROJECT $repo" $repo_bundle_dir/CMakeLists.txt | awk '{print $8}') @@ -59,8 +63,8 @@ for repo in $LIB_REPOS $MAIN_REPO; do # save the version info to a file verfile=$repo_bundle_dir/build.version rm -rf $verfile - echo "repo: $repo" > $verfile - echo "git_branch: $repo_branch" >> $verfile + echo "repo: $repo" > $verfile + echo "git_branch: $repo_branch" >> $verfile echo "git_hash: $repo_hash" >> $verfile echo "build_type: $LIB_BUILD_TYPE" >> $verfile echo "dependency_repo: $prev_repo" >> $verfile