-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
70 lines (62 loc) · 2.69 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
language: cpp
sudo: required
services:
- docker
env:
matrix:
- DISTRO=ubuntu
- DISTRO=ubuntu COVERAGE=ON
- DISTRO=fedora DOCKERHUB=ON
- DISTRO=fedora COVERAGE=ON
script:
- cp -vr docker ${HOME}/docker
- sed -i "1s/fedora/${DISTRO}/" ${HOME}/docker/Dockerfile
- cd ../../
- mv -v ${TRAVIS_REPO_SLUG} $HOME/docker/git-src
- cp -r $HOME/.ccache ${HOME}/docker/ccache
- cp -r $HOME/.sonar ${HOME}/docker/sonar
- travis_retry timeout 300 docker pull $(sed -n '1s/FROM //p' ${HOME}/docker/Dockerfile)
- travis_retry docker build
--build-arg COVERAGE=${COVERAGE}
--build-arg CC=${CC} --build-arg CXX=${CXX}
--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 CI=${CI} --build-arg TRAVIS=${TRAVIS} --build-arg TRAVIS_OS_NAME=${DISTRO}
--build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
-t ${TRAVIS_REPO_SLUG}:latest ${HOME}/docker/ &&
rm -rf ${HOME}/.ccache &&
CON=$(docker run -d ${TRAVIS_REPO_SLUG}:latest /bin/bash) &&
docker cp ${CON}:/home/user/.ccache ${HOME}/ &&
docker cp ${CON}:/home/user/.sonar ${HOME}/
after_success:
- if [[ ${DOCKERHUB} && ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_BRANCH} == master && ${TRAVIS_PULL_REQUEST} == false ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
if [[ ${CC} == gcc ]]; then docker push "${TRAVIS_REPO_SLUG}:latest"; fi;
fi
- if [[ ${DISTRO} = fedora && ${COVERAGE} && ${CC} = gcc ]]; then
cd $HOME/docker/git-src;
git fetch origin gh-pages && git checkout -b gh-pages FETCH_HEAD;
docker cp ${CON}:/home/user/git-src/build/doc/html . ;
mv html/* .;
rmdir html;
git add --all;
if [[ ${TRAVIS_BRANCH} = master && ${encrypted_2cc9b7dfce26_key} && ${encrypted_2cc9b7dfce26_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then
git config --global user.name "Automatic Deployment (Travis CI)";
git config --global user.email "[email protected]";
git commit -m "Documentation Update";
openssl aes-256-cbc -K $encrypted_2cc9b7dfce26_key -iv $encrypted_2cc9b7dfce26_iv -in deploy.enc -out ~/.ssh/id_rsa -d;
chmod 600 ~/.ssh/id_rsa;
git push [email protected]:${TRAVIS_REPO_SLUG} gh-pages:gh-pages;
else
git status;
git diff --cached --no-color | head -n 500;
fi;
fi
cache:
ccache: true
directories:
- $HOME/.sonar
compiler:
- gcc
- clang