Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:okfn/ckan into 408-remove-legacy-…
…org-code
- Loading branch information
Showing
504 changed files
with
19,510 additions
and
14,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,16 @@ | ||
language: python | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq solr-jetty | ||
install: | ||
- "pip install -r pip-requirements.txt --use-mirrors" | ||
- "pip install -r pip-requirements-test.txt --use-mirrors" | ||
before_script: | ||
- psql -c 'CREATE DATABASE ckantest;' -U postgres | ||
- psql -c 'CREATE DATABASE datastore;' -U postgres | ||
- psql -c 'CREATE USER readonlyuser;' -U postgres | ||
- python setup.py develop | ||
- paster make-config ckan development.ini --no-interactive | ||
- sed -i -e 's/.*solr_url.*/solr_url = http:\/\/127.0.0.1:8983\/solr/' development.ini | ||
- sed -i -e 's/.*ckan\.site_id.*/ckan.site_id = travis_ci/' development.ini | ||
- sed -i -e 's/^sqlalchemy.url.*/sqlalchemy.url = postgresql:\/\/postgres@localhost\/ckantest/' development.ini | ||
- sed -i -e 's/.*datastore.write_url.*/ckan.datastore.write_url = postgresql:\/\/postgres@localhost\/datastore/' development.ini | ||
- sed -i -e 's/.*datastore.read_url.*/ckan.datastore.read_url = postgresql:\/\/readonlyuser@localhost\/datastore/' development.ini | ||
- cat development.ini | ||
- echo -e "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty | ||
- sudo cp ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml | ||
- sudo service jetty restart | ||
- paster --plugin=ckan db init | ||
- sed -i -e 's/ -W//g' ckanext/datastore/bin/datastore_setup.py | ||
- paster datastore set-permissions postgres | ||
script: "nosetests --ckan ckan && nosetests --ckan --with-pylons=test-core.ini --nologcapture --cover-package=ckanext.datastore ckanext/datastore/tests -x" | ||
env: | ||
- PGVERSION=9.1 | ||
- PGVERSION=8.4 | ||
script: ./bin/travis-build | ||
notifications: | ||
irc: | ||
channels: | ||
- "irc.freenode.org#ckan" | ||
on_success: never | ||
on_failure: change | ||
template: | ||
- "%{repository} (%{branch} - %{commit}) [%{build_url}] %{author}: %{message}" | ||
- "%{repository} %{branch} %{commit} %{build_url} %{author}: %{message}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/sh | ||
|
||
# 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 | ||
# We need this ppa so we can install postgres-8.4 | ||
sudo add-apt-repository -yy ppa:pitti/postgresql | ||
sudo apt-get update -qq | ||
sudo apt-get install solr-jetty postgresql-$PGVERSION | ||
|
||
# Don't require a password to access DB | ||
sudo sed -i -e 's/ident/trust/g' /etc/postgresql/$PGVERSION/main/pg_hba.conf | ||
|
||
sudo service postgresql reload | ||
|
||
pip install -r pip-requirements.txt --use-mirrors | ||
pip install -r pip-requirements-test.txt --use-mirrors | ||
|
||
psql -c 'CREATE DATABASE ckantest;' -U postgres | ||
psql -c 'CREATE DATABASE datastore;' -U postgres | ||
|
||
python setup.py develop | ||
|
||
# Configure CKAN's configuration file | ||
paster make-config ckan development.ini --no-interactive | ||
sed -i -e 's/.*solr_url.*/solr_url = http:\/\/127.0.0.1:8983\/solr/' development.ini | ||
sed -i -e 's/.*ckan\.site_id.*/ckan.site_id = travis_ci/' development.ini | ||
sed -i -e 's/^sqlalchemy.url.*/sqlalchemy.url = postgresql:\/\/postgres@\/ckantest/' development.ini | ||
sed -i -e 's/.*datastore.write_url.*/ckan.datastore.write_url = postgresql:\/\/postgres@\/datastore/' development.ini | ||
|
||
# Configure Solr | ||
echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty | ||
sudo cp ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml | ||
sudo service jetty restart | ||
|
||
paster --plugin=ckan db init | ||
|
||
# If Postgres >= 9.0, we don't need to use datastore's legacy mode. | ||
if [ $PGVERSION != '8.4' ] | ||
then | ||
psql -c 'CREATE USER readonlyuser;' -U postgres | ||
sed -i -e 's/.*datastore.read_url.*/ckan.datastore.read_url = postgresql:\/\/readonlyuser@\/datastore/' development.ini | ||
paster datastore set-permissions postgres | ||
fi | ||
|
||
|
||
# And finally, run the tests | ||
nosetests --ckan --with-pylons=test-core.ini --nologcapture ckan ckanext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file contains commonly used parts of external libraries. The idea is | ||
# to help in removing helpers from being used as a dependency by many files | ||
# but at the same time making it easy to change for example the json lib | ||
# used. | ||
# | ||
# NOTE: This file is specificaly created for | ||
# from ckan.common import x, y, z to be allowed | ||
|
||
|
||
from pylons.i18n import _, ungettext | ||
from pylons import g, c, request, session, response | ||
import simplejson as json | ||
|
||
try: | ||
from collections import OrderedDict # from python 2.7 | ||
except ImportError: | ||
from sqlalchemy.util import OrderedDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.