This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
forked from tango-controls/cppTango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (63 loc) · 2.74 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
dist: xenial
language: cpp
env:
matrix:
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=DEBUG SONAR_SCANNER=OFF COVERALLS=OFF
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=ON COVERALLS=ON
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
- OS_TYPE=debian7 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
# - OS_TYPE=debian7 CMAKE_BUILD_TYPE=DEBUG
# - OS_TYPE=win32
# etc
notifications:
email: false
services:
- docker
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
update: true
sonarcloud:
organization: "tango-controls"
token:
secure: ${SONAR_TOKEN}
before_install:
- docker pull tangocs/mysql:9.2.2
- docker pull tangocs/tango-cs:latest
- git clone https://github.com/JoakimSoderberg/coveralls-cmake.git
- git clone -b v4.2.2 https://${CI_USER_TOKEN}@github.com/zeromq/cppzmq.git cppzmq
- git clone -b tango-9-lts https://${CI_USER_TOKEN}@github.com/tango-controls/tango-idl.git idl
- wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && unzip build-wrapper-linux-x86.zip
before_script:
- docker run --name mysql_db -e MYSQL_ROOT_PASSWORD=root -d tangocs/mysql:9.2.2 --sql-mode=""
- CONTAINER=$(docker run --name tango_cs -e TANGO_HOST=127.0.0.1:10000 -e MYSQL_HOST=mysql_db:3306 -e MYSQL_USER=tango -e MYSQL_PASSWORD=tango -e MYSQL_DATABASE=tango --link mysql_db:mysql_db -d tangocs/tango-cs:latest)
- IPADDR=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' $CONTAINER)
- TANGO_HOST=${IPADDR}:10000
- docker build --build-arg APP_UID=$(id -u) --build-arg APP_GID=$(id -g) -t cpp_tango .travis/${OS_TYPE}
- docker run --name cpp_tango -e TANGO_HOST=${TANGO_HOST} -e BINTRAY_USER_NAME=tango-ci -e BINTRAY_API_KEY=${CI_BINTRAY_API_KEY} -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} --link tango_cs:tango_cs -v `pwd`:/home/tango/src -v `pwd`/idl:/home/tango/idl -v `pwd`/cppzmq:/home/tango/cppzmq -v `pwd`/coveralls-cmake:/home/tango/coveralls-cmake -v `pwd`/build-wrapper-linux-x86:/home/tango/build-wrapper-linux-x86 -dit cpp_tango
- .travis/install_tango_idl.sh
- .travis/install_cppzmq.sh
#work around gcov ignored by sonar
- sudo mkdir /home/tango && sudo mkdir /home/tango/src && sudo mount --bind `pwd` /home/tango/src
script:
- .travis/${OS_TYPE}/run.sh
- .travis/test.sh COVERALLS=OFF
after_success:
- test ${SONAR_SCANNER} = "ON" && .travis/sonar.sh
deploy:
- provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
tags: true
after-script:
- docker stop cpp_tango
- docker rm cpp_tango
- docker stop tango_cs
- docker rm tango_cs
- docker stop mysql_db
- docker rm mysql_db