-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
79 lines (73 loc) · 2.72 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
71
72
73
74
75
76
77
78
79
language: c
sudo: required
services:
- docker
cache:
ccache: true
branches:
only:
- master
stages:
- name: cmake
- name: mpich
- name: openmpi
- name: deps
- name: env
jobs:
fast_finish: true
include:
- stage: cmake
env: DISTRO=ubuntu18 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=fedora30 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=centos8 DOCKERHUB=true DEPLOY=yes
- stage: mpich
env: DISTRO=ubuntu18 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=fedora30 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=centos8 DOCKERHUB=true DEPLOY=yes
- stage: openmpi
env: DISTRO=ubuntu18 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=fedora30 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=centos8 DOCKERHUB=true DEPLOY=yes
- stage: deps
env: DISTRO=ubuntu18 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=fedora30 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=centos8 DOCKERHUB=true DEPLOY=yes
- stage: env
env: DISTRO=ubuntu18 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=fedora30 DOCKERHUB=true DEPLOY=yes
- env: DISTRO=centos8 DOCKERHUB=true DEPLOY=yes
script:
- if [[ ${TRAVIS_BRANCH} != master ]]; then TAG="${TAG}_${TRAVIS_BRANCH//[^a-zA-Z0-9]/_}"; fi
- ls ${DISTRO}
- mkdir ${HOME}/docker
- cp -v ${DISTRO}/${TRAVIS_BUILD_STAGE_NAME} ${HOME}/docker/Dockerfile
- if [[ ${TRAVIS_BUILD_STAGE_NAME} = cmake ]]; then
cp -v ${DISTRO}/packages.yaml ${HOME}/docker/;
cd config;
cp -v mirrors.yaml ${HOME}/docker/;
cp -v -R mirror ${HOME}/docker/;
cp -v entrypoint.sh ${HOME}/docker/;
travis_wait 50 docker build -t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}_tmp ${HOME}/docker/;
fi
- if [[ ${TRAVIS_BUILD_STAGE_NAME} = mpich ]]; then
travis_wait 50 docker build -t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}_tmp ${HOME}/docker/;
fi
- if [[ ${TRAVIS_BUILD_STAGE_NAME} = openmpi ]]; then
travis_wait 50 docker build -t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}_tmp ${HOME}/docker/;
fi
- if [[ ${TRAVIS_BUILD_STAGE_NAME} = deps ]]; then
travis_wait 50 docker build -t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}_tmp ${HOME}/docker/;
fi
- if [[ ${TRAVIS_BUILD_STAGE_NAME} = env ]]; then
travis_wait 50 docker build -t ${TRAVIS_REPO_SLUG}:${DISTRO}${TAG} ${HOME}/docker/;
fi
after_success:
- shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master) ]] && DEPLOY=yes
- if [[ ${DOCKERHUB} = true && ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
if [[ ${TRAVIS_BUILD_STAGE_NAME} = env ]]; then
docker push "${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}";
else
docker push "${TRAVIS_REPO_SLUG}:${DISTRO}${TAG}_tmp";
fi
fi