Fix CKAN scripts
This commit is contained in:
parent
89d3dd7d0c
commit
f9cc283477
@ -16,28 +16,28 @@ cp postgres_data/pg_hba.conf /srv/ckan/postgres_data/pg_hba.conf
|
||||
# Create database
|
||||
export CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
|
||||
export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
|
||||
lxc-start ckan_postgres #TODO: wait?
|
||||
service ckan_postgres start #TODO: wait?
|
||||
envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql
|
||||
|
||||
# Configure Redis
|
||||
mkdir -p /srv/ckan/redis_conf /srv/ckan/redis_data
|
||||
cp redis_conf/redis.conf /srv/ckan/redis_conf/redis.conf
|
||||
chown -R 106379:106379 /srv/ckan/redis_data
|
||||
lxc-start ckan_redis
|
||||
service ckan_redis start
|
||||
|
||||
# Configure Solr
|
||||
mkdir -p /srv/ckan/solr_data
|
||||
lxc-execute ckan_solr -- cat /opt/solr/server/solr/solr.xml >/srv/ckan/solr_data/solr.xml
|
||||
chown -R 108983:108983 /srv/ckan/solr_data
|
||||
lxc-start ckan_solr # TODO: wait?
|
||||
service ckan_solr start # TODO: add ready / wait
|
||||
|
||||
# Configure CKAN Solr core
|
||||
lxc-attach -u 8983 -g 8983 ckan_solr -- solr create -p 8983 -c ckan # TODO: wait to ensure creation?
|
||||
lxc-stop ckan_solr
|
||||
service ckan_solr stop
|
||||
cp solr_data/ckan/conf/schema.xml /srv/ckan/solr_data/ckan/conf/schema.xml
|
||||
cp solr_data/ckan/conf/solrconfig.xml /srv/ckan/solr_data/ckan/conf/solrconfig.xml
|
||||
chown 108983:108983 /srv/ckan/solr_data/ckan/conf/schema.xml # TODO: je to potreba?
|
||||
lxc-start ckan_solr # TODO: wait?
|
||||
service ckan_solr start
|
||||
|
||||
# Configure CKAN DataPusher
|
||||
mkdir -p /srv/ckan/datapusher_conf /srv/ckan/datapusher_data
|
||||
@ -71,9 +71,9 @@ envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql ckan
|
||||
cp update-conf.sh /srv/ckan/update-conf.sh
|
||||
|
||||
# Stop services required for setup
|
||||
lxc-stop ckan_solr
|
||||
lxc-stop ckan_postgres
|
||||
lxc-stop ckan_redis
|
||||
service ckan_solr stop
|
||||
service ckan_postgres stop
|
||||
service ckan_redis stop
|
||||
|
||||
# Register application
|
||||
vmmgr register-app ckan ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -ev
|
||||
|
||||
# Remove persistent data
|
||||
rm -f /srv/ckan
|
||||
rm -rf /srv/ckan
|
||||
|
||||
# Unregister application
|
||||
vmmgr unregister-app ckan
|
||||
|
Loading…
Reference in New Issue
Block a user