]> git.openstreetmap.org Git - nominatim.git/blob - vagrant/install-on-travis-ci.sh
693be306e90b3292ca3bb61c573fce4402d258f3
[nominatim.git] / vagrant / install-on-travis-ci.sh
1 #!/bin/bash
2
3 # This script runs in a travis-ci.org (or .com) virtual machine
4 # https://docs.travis-ci.com/user/trusty-ci-environment/
5 # Ubuntu 14 (trusty)
6 # user 'travis'
7 # $TRAVIS_BUILD_DIR is /home/travis/build/twain47/Nominatim/, for more see
8 #   https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
9 # Postgres 9.2 installed and started. role 'travis' already superuser
10 # Python 2.7.10, pip 7.1.2
11
12 # Travis has a 4 MB, 10000 line output limit, so where possible we supress
13 #  output from installation scripts
14 # Travis strips color from the output
15
16 sudo service postgresql stop
17
18 sudo apt-get update -qq
19 sudo apt-get install -y -qq libboost-dev libboost-system-dev \
20                         libboost-filesystem-dev libexpat1-dev zlib1g-dev libxml2-dev\
21                         libbz2-dev libpq-dev libgeos-c1 libgeos++-dev libproj-dev \
22                         postgresql-server-dev-9.3 postgresql-9.3-postgis-2.1 postgresql-contrib-9.3 \
23                         apache2 php5 php5-pgsql php-pear php-db
24
25 sudo apt-get install -y -qq python-Levenshtein python-shapely \
26                         python-psycopg2 tidy python-nose python-tidylib \
27                         python-numpy phpunit
28
29 sudo -H pip install --quiet 'setuptools>=23.0.0' lettuce==0.2.18 'six>=1.9' haversine
30 sudo pear install PHP_CodeSniffer
31
32 sudo service postgresql restart
33 sudo -u postgres createuser -S www-data
34
35 # Make sure that system servers can read from the home directory:
36 chmod a+x $HOME
37 chmod a+x $TRAVIS_BUILD_DIR
38
39
40 sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF > /dev/null
41     <Directory "$TRAVIS_BUILD_DIR/build/website">
42       Options FollowSymLinks MultiViews
43       AddType text/html   .php
44       DirectoryIndex search.php
45       Require all granted
46     </Directory>
47
48     Alias /nominatim $TRAVIS_BUILD_DIR/build/website
49 EOFAPACHECONF
50
51
52 sudo a2enconf nominatim
53 sudo service apache2 restart
54
55
56 mkdir build
57 cd build
58 cmake $TRAVIS_BUILD_DIR
59 make
60
61
62 tee settings/local.php << EOF
63 <?php
64  @define('CONST_Website_BaseURL', '/nominatim/');
65 EOF