]> git.openstreetmap.org Git - nominatim.git/blob - vagrant/install-on-travis-ci.sh
Merge remote-tracking branch 'upstream/master' into cmake-port
[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
31 sudo service postgresql restart
32 sudo -u postgres createuser -S www-data
33
34 # Make sure that system servers can read from the home directory:
35 chmod a+x $HOME
36 chmod a+x $TRAVIS_BUILD_DIR
37
38
39 sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF > /dev/null
40     <Directory "$TRAVIS_BUILD_DIR/build/website">
41       Options FollowSymLinks MultiViews
42       AddType text/html   .php
43       Require all granted
44     </Directory>
45
46     Alias /nominatim $TRAVIS_BUILD_DIR/build/website
47 EOFAPACHECONF
48
49
50 sudo a2enconf nominatim
51 sudo service apache2 restart
52
53
54 mkdir build
55 cd build
56 cmake $TRAVIS_BUILD_DIR
57 make
58
59
60 tee settings/local.php << EOF
61 <?php
62  @define('CONST_Website_BaseURL', '/nominatim/');
63 EOF