-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
86 lines (73 loc) · 3.52 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
83
84
85
86
# Travis CI build configuration config file.
# Used environment variables (see: http://docs.travis-ci.com/user/ci-environment/):
# TRAVIS_BUILD_DIR - The absolute path to the directory where the repository being built has been copied on the worker. (e.g. "/home/travis/build/mycognitive/ads")
# TRAVIS_REPO_SLUG - The slug (in form: owner_name/repo_name) of the repository currently being built. (e.g. "mycognitive/ads")
# Before Install
# Use this to prepare the system to install prerequisites or dependencies.
# Commonly used to update git repository submodules and do similar tasks that need to be performed before dependencies are installed.
before_install:
- env
- sudo sysctl kernel.hostname=ads.server
# Install
# Use this to install any prerequisites or dependencies necessary to run your build.
install:
- sudo sh ./configure install
- composer require drush/drush:6.2.0
- cat puppet/travis.pp puppet/ads.dev.pp puppet/solr3-tomcat.pp puppet/apache-mod_geoip2.pp puppet/php5-xcache.pp puppet/mta-postfix.pp puppet/php5-memcached.pp | sudo puppet apply
- sudo ps aux | grep memcached
- sudo puppet module list
# Before Script
# Use this to prepare your build for testing (e.g. copy database configurations, environment variables, etc.).
before_script:
- export FACTER_ads_docroot=$SRCDIR
- export FACTER_ads_host=$HOST
- facter -p | grep 'ads_'
- cat puppet/travis.pp puppet/ads.dev.pp puppet/solr3-tomcat.pp puppet/ads.dev.configure-site.pp puppet/apache-mod_geoip2.pp puppet/php5-xcache.pp puppet/php5-memcached.pp | sudo puppet apply # Apply webroot puppet configuration.
- sed -i'.bak' "s|^includes\[\] = drush/includes|;includes\[\] = drush/includes|" $TRAVIS_BUILD_DIR/build-ads-*.make # Ignore feature includes for this repo.
# Script
# Main build command to run.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
- set -e # This makes build to fail on first error.
- ln -sv $TRAVIS_BUILD_DIR/travis/travis.build.properties build.properties
- sh -x ./scripts/puppet_check.sh
- make
- sudo touch /var/www/ads/index.php
- sudo chown travis /var/www/ads/index.php
- echo "<?php echo 'PHP memcached module existence = '; var_dump(extension_loaded('memcached')); echo 'PHP server globals = '; print_r(\$_SERVER); echo 'PHP geoip2 data = '; print_r(geoip_record_by_name('php.net')); ?>" > /var/www/ads/index.php
- sudo wget -qO- http://ads.server/ | cat
# Note: Do not install build in this repo.
# - make install
# - sudo mv $TRAVIS_BUILD_DIR/src/* $SRCDIR/
# - sudo chmod -R 777 $SRCDIR/
# - sudo wget -qO- http://ads.server/ | cat
# - cd $SRCDIR && pwd && ls && echo "$DRUSH" && $DRUSH -y en simpletest && php ./scripts/run-tests.sh --php `which php` --url http://ads.server/ --concurrency 16 --verbose System
# After Success
# Note: The standard Unix exit code of "0" means the build passed; everything else is treated as failure.
after_success:
- tree -d -L 6 # Print directory structure in the form of a tree.
# After Failure
after_failure:
- sh -x $TRAVIS_BUILD_DIR/travis/scripts/after_failure.sh
# After Script
# Test result is exported to TRAVIS_TEST_RESULT.
after_script:
- pwd
# Environment
env:
global:
- HOST="ads.server" URL="http://$HOST/"
- GIT_TRACE=1 GIT_SSH="/usr/bin/ssh -oStrictHostKeyChecking=no "
- DRUSH="drush -y -r $SRCDIR --uri=$URL"
matrix:
- SRCDIR="/var/www/ads"
notifications:
email: false
addons:
hosts:
- ads.server
language: php
# PHP versions to test against.
# See: http://docs.travis-ci.com/user/languages/php/
php:
- 5.5