forked from puppetlabs/puppetdb-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_target.sh
executable file
·50 lines (43 loc) · 1.49 KB
/
.travis_target.sh
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
#!/bin/bash
set -ev
# Set compiler to GCC 4.8 here, as Travis overrides the global variables.
export CC=gcc-4.8 CXX=g++-4.8
if [ ${TRAVIS_TARGET} == CPPCHECK ]; then
# grab a pre-built cppcheck from s3
wget https://s3.amazonaws.com/kylo-pl-bucket/pcre-8.36_install.tar.bz2
tar xjvf pcre-8.36_install.tar.bz2 --strip 1 -C $USERDIR
wget https://s3.amazonaws.com/kylo-pl-bucket/cppcheck-1.69_install.tar.bz2
tar xjvf cppcheck-1.69_install.tar.bz2 --strip 1 -C $USERDIR
elif [ ${TRAVIS_TARGET} == DOXYGEN ]; then
# grab a pre-built doxygen 1.8.7 from s3
wget https://s3.amazonaws.com/kylo-pl-bucket/doxygen_install.tar.bz2
tar xjvf doxygen_install.tar.bz2 --strip 1 -C $USERDIR
elif [ ${TRAVIS_TARGET} == DEBUG ]; then
# Install coveralls.io update utility
pip install --user cpp-coveralls
fi
# Generate build files
if [ ${TRAVIS_TARGET} == DEBUG ]; then
TARGET_OPTS="-DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=ON"
fi
cmake $TARGET_OPTS -DCMAKE_INSTALL_PREFIX=$USERDIR .
if [ ${TRAVIS_TARGET} == CPPLINT ]; then
make cpplint
elif [ ${TRAVIS_TARGET} == DOXYGEN ]; then
# Build docs
pushd lib
doxygen 2>&1 | ( ! grep . )
popd
elif [ ${TRAVIS_TARGET} == CPPCHECK ]; then
make cppcheck
else
make -j2
make test ARGS=-V
# Make sure installation succeeds
make install
# Disable coveralls for private repos
if [ ${TRAVIS_TARGET} == DEBUG ]; then
# Ignore coveralls failures, keep service success uncoupled
coveralls --gcov gcov-4.8 --gcov-options '\-lp' >/dev/null || true
fi
fi