forked from sni/Thruk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (58 loc) · 3.26 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
sudo: required
group: deprecated-2017Q2
language: generic
services:
- docker
before_install:
- sudo apt-get update
- sudo sh -c "echo 'deb http://labs.consol.de/repo/stable/ubuntu $(lsb_release -cs) main' >> /etc/apt/sources.list"
- wget -q "http://labs.consol.de/repo/stable/RPM-GPG-KEY" -O - | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -y install make build-essential rsync perl-doc tofrodos libcurl4-openssl-dev apache2 apache2-utils libcairo2-dev libperl-dev libmysqlclient-dev libgd2-xpm-dev cpanminus yui-compressor wget
- sudo apt-get -y install libfile-bom-perl libhtml-lint-perl libtest-simple-perl libtest-cmd-perl libtest-pod-perl libmodule-install-perl libgd-gd2-perl libdevel-cycle-perl
- sudo apt-get -y install libtest-pod-coverage-perl libperl-critic-perl libtest-perl-critic-perl libtemplate-perl libdate-calc-perl liblog-log4perl-perl libconfig-general-perl
- sudo apt-get -y install libmime-lite-perl phantomjs
- sudo apt-get -y install mysql-client mysql-server
- sudo apt-get -y install naemon-core naemon-livestatus
- sudo /etc/init.d/naemon restart
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
# newer version are broken when using symlinks
- cpanm -n http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/ExtUtils-Manifest-1.63.tar.gz
- cpanm -n Perl::Critic::Policy::Dynamic::NoIndirect Perl::Critic::Policy::NamingConventions::ProhibitMixedCaseSubs Perl::Critic::Policy::ValuesAndExpressions::ProhibitAccessOfPrivateData List::Compare Devel::Gladiator PadWalker Perl::Critic::Policy::Modules::ProhibitPOSIXimport
- sed -i '/Test::JavaScript/d' ./Makefile.PL
- cpanm -q -f --installdeps --notest --no-man-pages .
- git config --global user.email "travis@localhost"
- git config --global user.name "Travis Testuser"
- echo "export PERL5LIB=\$PERL5LIB:$HOME/perl5/lib/perl5" > ~/.thruk
# ensure we have a test database in place for tests
- mysql -e "create database IF NOT EXISTS test;" -uroot
# ensure we have all modules loaded
- if [ $(perl Makefile.PL 2>&1 | grep -c missing) -ne 0 ]; then exit 1; fi
- '[ "$TRAVIS_BRANCH" != "e2e" -o "$TRAVIS_SECURE_ENV_VARS" == "false" ] || openssl aes-256-cbc -K $encrypted_9c186b83851c_key -iv $encrypted_9c186b83851c_iv -in t/scenarios/e2e/.dropbox_uploader.enc -out ~/.dropbox_uploader -d'
- sudo cat /etc/profile.d/perlbrew.sh
- sudo cat /opt/jdk_switcher/jdk_switcher.sh
- sudo rm -f /etc/profile.d/perlbrew.sh /opt/jdk_switcher/jdk_switcher.sh
install:
- ./configure || exit 1
- make || exit 1
- cp t/travis/thruk_local.conf .
- sudo chmod 660 /var/cache/naemon/live
- sudo gpasswd -a $(id -un) naemon
- touch .author
script:
- if [ "$TRAVIS_BRANCH" == "e2e" ]; then
make e2etest;
else
sudo su $(id -un) -c 'eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) && TEST_TRAVIS=1 TEST_AUTHOR=1 TEST_MYSQL="mysql://root@localhost:3306/test" make test';
fi
after_failure:
- '[ "$TRAVIS_BRANCH" != "e2e" -o ! -f ~/.dropbox_uploader ] || ./t/scenarios/e2e/dropbox_uploader.sh upload t/scenarios/e2e/_run/*/* thruk-travis/$TRAVIS_JOB_NUMBER/'
notifications:
email:
irc:
channels:
- "chat.freenode.net#thruk-dev"
on_success: change
on_failure: always
skip_join: true