-
Notifications
You must be signed in to change notification settings - Fork 2k
/
travis-install-dependencies
executable file
·51 lines (39 loc) · 1.5 KB
/
travis-install-dependencies
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
#!/bin/bash
# Exit immediately if any command fails
set -e
# Drop Travis' postgres cluster if we're building using a different pg version
TRAVIS_PGVERSION='9.1'
if [ $PGVERSION != $TRAVIS_PGVERSION ]
then
sudo -u postgres pg_dropcluster --stop $TRAVIS_PGVERSION main
# Make psql use $PGVERSION
export PGCLUSTER=$PGVERSION/main
fi
# Install postgres and solr
sudo apt-get update -qq
sudo apt-get install postgresql-$PGVERSION solr-jetty libcommons-fileupload-java:amd64=1.2.2-1
if [ $PGVERSION == '8.4' ]
then
# force postgres to use 5432 as it's port
sudo sed -i -e 's/port = 5433/port = 5432/g' /etc/postgresql/8.4/main/postgresql.conf
fi
sudo service postgresql restart
# Setup postgres' users and databases
sudo -E -u postgres ./bin/postgres_init/1_create_ckan_db.sh
sudo -E -u postgres ./bin/postgres_init/2_create_ckan_datastore_db.sh
export PIP_USE_MIRRORS=true
pip install -r requirements.txt --allow-all-external
pip install -r dev-requirements.txt --allow-all-external
python setup.py develop
# Install npm dpes for mocha
npm install -g mocha-phantomjs@3.5.0 phantomjs@~1.9.1
paster db init -c test-core.ini
# If Postgres >= 9.0, we don't need to use datastore's legacy mode.
if [ $PGVERSION != '8.4' ]
then
sed -i -e 's/.*datastore.read_url.*/ckan.datastore.read_url = postgresql:\/\/datastore_default:pass@\/datastore_test/' test-core.ini
paster datastore -c test-core.ini set-permissions | sudo -u postgres psql
else
sed -i -e 's/.*datastore.read_url.*//' test-core.ini
fi
cat test-core.ini