forked from laristra/flecsph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (48 loc) · 1.97 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
language: cpp
sudo: required
services:
- docker
env:
matrix:
- DISTRO=fedora MPI=ON DOCKERHUB=true
- DISTRO=ubuntu MPI=ON DOCKERHUB=true
- DISTRO=ubuntu MPI=ON COVERAGE=ON
script:
- cp -vr docker ${HOME}/docker
- sed -i "1s/fedora/${DISTRO}/" ${HOME}/docker/Dockerfile
- cd ../../
- mv -v ${TRAVIS_REPO_SLUG} $HOME/docker
- cp -r $HOME/.ccache ${HOME}/docker/ccache
- cp -r $HOME/.sonar ${HOME}/docker/sonar
- if [[ ${CC} != gcc ]]; then TAG="_${CC}"; fi
- docker build --build-arg MPI=${MPI}
--build-arg COVERAGE=${COVERAGE}
--build-arg CC=${CC} --build-arg CXX=${CXX}
--build-arg SONARQUBE=${SONARQUBE} --build-arg SONARQUBE_TOKEN=${SONARQUBE_TOKEN}
--build-arg SONARQUBE_GITHUB_TOKEN=${SONARQUBE_GITHUB_TOKEN}
--build-arg CI=${CI} --build-arg TRAVIS=${TRAVIS} --build-arg TRAVIS_OS_NAME=${DISTRO}
--build-arg TRAVIS_BRANCH=${TRAVIS_BRANCH} --build-arg TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
--build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} --build-arg TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
--build-arg TRAVIS_TAG=${TRAVIS_TAG} --build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}
--build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
-t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG} ${HOME}/docker/ &&
rm -rf ${HOME}/.ccache &&
CON=$(docker run -d ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG} /bin/bash) &&
docker cp ${CON}:/home/flecsi/.ccache ${HOME}/ &&
docker cp ${CON}:/home/flecsi/.sonar ${HOME}/
after_success:
- if [[ ${DOCKERHUB} = true && ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${TRAVIS_BRANCH} == master ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}";
fi
cache:
ccache: true
directories:
- $HOME/.sonar
branches:
only:
- master
- /^stable\/.*$/
compiler:
- gcc
# No openmp - clang