Skip to content

Commit

Permalink
Explicitly create a ckan core for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Mar 18, 2016
1 parent 1da4f6f commit 536a98b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions bin/solr_init/create_core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

INSTANCE_DIR=$SOLR_HOME/example/solr/$CKAN_SOLR_CORE
cp -R $SOLR_HOME/example/solr/collection1 $SOLR_HOME/example/solr/$CKAN_SOLR_CORE
cp $CKAN_SOLR_SCHEMA $SOLR_HOME/example/solr/$CKAN_SOLR_CORE/conf

curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=$CKAN_SOLR_CORE&instanceDir=$INSTANCE_DIR"
10 changes: 7 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ machine:
CKAN_DATASTORE_POSTGRES_WRITE_USER: ckan_default
CKAN_DATASTORE_POSTGRES_READ_USER: datastore_default
CKAN_DATASTORE_POSTGRES_READ_PWD: pass
CKAN_SOLR_CORE: ckan
CKAN_SOLR_SCHEMA: $HOME/ckan/ckan/config/solr/schema.xml
SOLR_HOME: $HOME/solr

dependencies:
override:
Expand All @@ -26,10 +29,11 @@ database:
- 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

- cp -R /opt/solr-4.3.1 $HOME/solr
- cp ckan/config/solr/schema.xml $HOME/solr/example/solr/collection1/conf
- cd $HOME/solr/example; java -jar start.jar >> $HOME/solr.log:
- cp -R /opt/solr-4.3.1 $SOLR_HOME
- cd $SOLR_HOME/example; java -jar start.jar >> $HOME/solr.log:
background: true
- sleep 5
- ./bin/solr_init/create_core.sh

- paster db init -c test-core.ini

Expand Down
2 changes: 1 addition & 1 deletion test-core.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ckan.datapusher.url = http://datapusher.ckan.org/
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

## Solr support
solr_url = http://127.0.0.1:8983/solr
solr_url = http://127.0.0.1:8983/solr/ckan

ckan.auth.user_create_organizations = true
ckan.auth.user_create_groups = true
Expand Down

0 comments on commit 536a98b

Please sign in to comment.