Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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
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,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();']) |