Skip to content

Commit

Permalink
travis.py: first shot
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 15, 2013
1 parent 061fdc4 commit 31e8ef8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ python:
env:
- PGVERSION=9.1
- PGVERSION=8.4
script: ./bin/travis-build
script: ./bin/travis.py
notifications:
irc:
channels:
Expand Down
28 changes: 28 additions & 0 deletions bin/travis.py
@@ -0,0 +1,28 @@
#!/usr/bin/env python

import os
import sys
import subprocess

PG_VERSION = os.environ.get('PGVERSION')
PYTHON_2_6 = sys.version_info < (2, 7)

sql = '''
CREATE USER ckanuser WITH PASSWORD 'pass';
CREATE USER readonlyuser WITH PASSWORD 'pass';
CREATE DATABASE ckan_test WITH OWNER ckanuser;
CREATE DATABASE ckan_test_datastore WITH OWNER ckanuser;
'''


def shell(arg):
subprocess.call(arg)

# Install postgres and solr
# We need this ppa so we can install postgres-8.4
shell(['sudo', 'add-apt-repository', '-yy', 'ppa:pitti/postgresql'])
shell(['sudo', 'apt-get', 'update', '-qq'])
shell(['sudo', 'apt-get', 'install', 'solr-jetty', 'postgresql-%s' % PG_VERSION])

shell(['psql', '-U', 'ckanuser', 'ckan_test', '-c', 'SELECT version();'])

0 comments on commit 31e8ef8

Please sign in to comment.