forked from laristra/flecsi-sp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (31 loc) · 1.51 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
language: cpp
sudo: required
services:
- docker
env:
matrix:
- DISTRO=fedora_mpi BUILD_TYPE=Release DOCKERHUB=true
- DISTRO=ubuntu_mpi BUILD_TYPE=Debug DOCKERHUB=true
script:
- if [[ ${CC} != gcc ]]; then TAG="_${CC}"; fi
- if [[ ${TRAVIS_BRANCH} != stable ]]; then TAG="${TAG}_master"; fi
- cp -vr docker ${HOME}/docker
- sed -i "1s/fedora_serial/${DISTRO}${TAG}/" ${HOME}/docker/Dockerfile
- cd ../../
- mv -v ${TRAVIS_REPO_SLUG} $HOME/docker
- docker build --build-arg BUILD_TYPE=${BUILD_TYPE}
--build-arg CC=${CC} --build-arg CXX=${CXX}
--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/ &&
CON=$(docker run -d ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG} /bin/bash)
after_success:
- if [[ ${DOCKERHUB} = true && ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${TRAVIS_BRANCH} == master && ${CC} = gcc ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}";
fi
compiler:
- gcc