forked from JCSDA/ioda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (59 loc) · 2.91 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#======================================================================
# Project settings
#======================================================================
branches:
only:
- develop
language: cpp
services:
- docker
before_install:
- date
- REPO_SOURCE_DIR=${TRAVIS_BUILD_DIR}/jcsda/src_repo
# create the same file structure on Travis VM and Docker container
- mkdir -p ${TRAVIS_BUILD_DIR}/jcsda/src_repo
# echo branch info
- echo $TRAVIS_PULL_REQUEST
- echo $TRAVIS_PULL_REQUEST_BRANCH
- echo $TRAVIS_BRANCH
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
#======================================================================
# Clone all repos
#======================================================================
# clone the testing branch of ioda
- git clone -b $BRANCH https://github.com/jcsda/ioda.git ${REPO_SOURCE_DIR}/ioda-bundle/ioda
# checkout for the same branch name in oops
- git clone https://github.com/jcsda/oops.git ${REPO_SOURCE_DIR}/ioda-bundle/oops
- cd ${REPO_SOURCE_DIR}/ioda-bundle/oops
- git checkout $BRANCH || echo "No branch named $BRANCH in oops repo"
- cd $REPO_SOURCE_DIR
- if [ "$BRANCH" = "develop" ];
then export BRANCH_FORK="release-stable";
else export BRANCH_FORK=$BRANCH;
fi
# checkout for the same branch name in fckit
- git clone https://github.com/jcsda-internal/fckit.git ${REPO_SOURCE_DIR}/ioda-bundle/fckit
- cd ${REPO_SOURCE_DIR}/ioda-bundle/fckit
- git checkout $BRANCH_FORK || echo "No branch named $BRANCH in atlas repo"; git checkout release-stable
- cd $REPO_SOURCE_DIR
# checkout for the same branch name in atlas
- git clone https://github.com/jcsda-internal/atlas.git ${REPO_SOURCE_DIR}/ioda-bundle/atlas
- cd ${REPO_SOURCE_DIR}/ioda-bundle/atlas
- git checkout $BRANCH_FORK || echo "No branch named $BRANCH in atlas repo"; git checkout release-stable
- cd $REPO_SOURCE_DIR
# move CMakeLists.txt
- cp ${TRAVIS_BUILD_DIR}/CI/CMakeLists.txt ${REPO_SOURCE_DIR}/ioda-bundle
- cp -r ${TRAVIS_BUILD_DIR}/CI/cmake ${REPO_SOURCE_DIR}/ioda-bundle/
#======================================================================
# Pull docker image
#======================================================================
- docker pull jcsda/docker-clang-mpich-dev
- docker images
script:
- docker run -d -t --name clang_container -v ${REPO_SOURCE_DIR}/ioda-bundle:/jcsda/src_repo jcsda/docker-clang-mpich-dev
- docker exec clang_container bash -c 'ls /jcsda/src_repo'
- docker exec clang_container bash -c 'mkdir /build_container'
- docker exec clang_container bash -c 'cd /build_container && ecbuild /jcsda/src_repo'
- docker exec clang_container bash -c 'cd /build_container/ioda && make -j4'
- docker exec clang_container bash -c 'cd /build_container/ioda && ctest --output-on-failure'