forked from espressopp/espressopp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (75 loc) · 3.5 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
80
81
82
language: cpp
sudo: required
services:
- docker
env:
matrix:
- DISTRO=ubuntu EXTERNAL=ON BUILD_UG=ON
- DISTRO=ubuntu EXTERNAL=ON COVERAGE=ON
- DISTRO=ubuntu EXTERNAL=OFF
- DISTRO=ubuntu_rolling EXTERNAL=ON
- DISTRO=ubuntu_rolling EXTERNAL=OFF
- DISTRO=ubuntu_mpich EXTERNAL=ON BUILD_UG=ON
- DISTRO=ubuntu_mpich EXTERNAL=ON COVERAGE=ON
- DISTRO=ubuntu_mpich EXTERNAL=OFF
- DISTRO=fedora EXTERNAL=ON
- DISTRO=fedora EXTERNAL=ON COVERAGE=ON
- DISTRO=fedora EXTERNAL=OFF
- DISTRO=fedora_mpich EXTERNAL=ON
- DISTRO=fedora_mpich EXTERNAL=ON COVERAGE=ON
- DISTRO=fedora_mpich EXTERNAL=OFF
script:
- cp -vr docker ${HOME}
- sed -i "1s/ubuntu/${DISTRO}/" ${HOME}/docker/Dockerfile
- cd ../../
- mv -v ${TRAVIS_REPO_SLUG} $HOME/docker
- cp -r $HOME/.ccache ${HOME}/docker/ccache
- if [[ ${TRAVIS_BRANCH} = master ]]; then DOCKER_TAG=latest; else DOCKER_TAG="${TRAVIS_BRANCH}"; fi
- travis_retry timeout 540 docker pull $(sed -n '1s/from //p' ${HOME}/docker/Dockerfile)
- docker build --build-arg COVERAGE=${COVERAGE} --build-arg EXTERNAL=${EXTERNAL}
--build-arg CC=${CC} --build-arg CXX=${CXX} --build-arg BUILD_UG=${BUILD_UG}
--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 espressopp/espressopp:${DOCKER_TAG} ${HOME}/docker/ &&
rm -rf $HOME/.ccache &&
CON=$(docker run -d espressopp/espressopp:${DOCKER_TAG} /bin/bash) &&
docker cp ${CON}:/home/espressopp/.ccache ${HOME}/
after_success:
- shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master|v1.*) ]] && DEPLOY=yes
- if [[ ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} && ${TRAVIS_JOB_NUMBER} = *.1 ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "espressopp/espressopp:${DOCKER_TAG}";
fi
- if [[ ${BUILD_UG} = ON && ${TRAVIS_JOB_NUMBER} = *.1 ]]; then
git clone --depth 1 https://github.com/espressopp/espressopp.github.io.git html;
CON=$(docker run -d espressopp/espressopp:${DOCKER_TAG}) && docker cp ${CON}:/home/espressopp/espressopp/doc . ;
if [[ ${TRAVIS_BRANCH} = v1.* ]]; then
rm -rf html/${TRAVIS_BRANCH};
mkdir -p html/${TRAVIS_BRANCH};
mv doc/ug/_build/html/* html/${TRAVIS_BRANCH};
else
rm -rf html/[^v][^1]*;
mv doc/dg/html html/doxygen;
mv doc/ug/_build/latex/ESPResSo++.pdf html/;
mv doc/ug/_build/html/* html/;
fi;
rm -rvf doc;
cd html;
if [[ ${DEPLOY} && ${encrypted_194b3d1e9306_key} && ${encrypted_194b3d1e9306_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then
git config --global user.name "Automatic Deployment (Travis CI)";
git config --global user.email "[email protected]";
git add --all && git commit -m "Documentation Update";
openssl aes-256-cbc -K $encrypted_194b3d1e9306_key -iv $encrypted_194b3d1e9306_iv -in $HOME/docker/espressopp/doc/ug/deploy.enc -out ~/.ssh/id_rsa -d;
chmod 600 ~/.ssh/id_rsa;
git push [email protected]:espressopp/espressopp.github.io.git master;
else
git diff --no-color | head -n 500;
fi;
fi
cache:
- ccache
compiler:
- gcc
- clang