Call CKAN virtual env binaries directly
This commit is contained in:
parent
1c2596c949
commit
b1aad14c5c
18
30-ckan.sh
18
30-ckan.sh
@ -11,12 +11,10 @@ apt-get -y --no-install-recommends install openjdk-8-jre-headless lsof
|
||||
# Install CKAN python virtual environment
|
||||
mkdir -p /srv/ckan
|
||||
virtualenv --no-site-packages --python=/usr/bin/python2.7 /srv/ckan
|
||||
. /srv/ckan/bin/activate
|
||||
pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan'
|
||||
pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher'
|
||||
pip install -r /srv/ckan/src/ckan/requirements.txt
|
||||
pip install -r /srv/ckan/src/datapusher/requirements.txt
|
||||
deactivate
|
||||
/srv/ckan/bin/pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan'
|
||||
/srv/ckan/bin/pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher'
|
||||
/srv/ckan/bin/pip install -r /srv/ckan/src/ckan/requirements.txt
|
||||
/srv/ckan/bin/pip install -r /srv/ckan/src/datapusher/requirements.txt
|
||||
|
||||
# Donwload Solr
|
||||
wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz
|
||||
@ -70,21 +68,19 @@ cp ${SOURCE_DIR}/ckan/srv/ckan/update-ip.sh /srv/ckan/update-ip.sh
|
||||
/srv/ckan/update-ip.sh
|
||||
|
||||
# Populate database
|
||||
. /srv/ckan/bin/activate
|
||||
paster --plugin=ckan db init -c /etc/ckan/ckan.ini
|
||||
paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | sudo -u postgres psql
|
||||
sudo -u ckan /srv/ckan/bin/paster --plugin=ckan db init -c /etc/ckan/ckan.ini
|
||||
sudo -u ckan /srv/ckan/bin/paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | sudo -u postgres psql
|
||||
|
||||
# Create admin account
|
||||
export CKAN_ADMIN_USER="admin"
|
||||
export CKAN_ADMIN_UUID=$(uuidgen -r)
|
||||
export CKAN_ADMIN_APIKEY=$(uuidgen -r)
|
||||
export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
||||
export CKAN_ADMIN_HASH=$(python ${SOURCE_DIR}/ckan/ckan-adminpwd.py ${CKAN_ADMIN_PWD})
|
||||
export CKAN_ADMIN_HASH=$(/srv/ckan/bin/python ${SOURCE_DIR}/ckan/ckan-adminpwd.py ${CKAN_ADMIN_PWD})
|
||||
export CKAN_ADMIN_EMAIL="admin@example.com"
|
||||
envsubst <${SOURCE_DIR}/ckan/tmp/ckan-adminpwd.sql >/tmp/ckan-adminpwd.sql
|
||||
sudo -u postgres psql -f /tmp/ckan-adminpwd.sql ckan
|
||||
rm /tmp/ckan-adminpwd.sql
|
||||
deactivate
|
||||
|
||||
# Create uwsgi and nginx app definition
|
||||
cp ${SOURCE_DIR}/ckan/etc/uwsgi/apps-available/ckan.ini /etc/uwsgi/apps-available/ckan.ini
|
||||
|
@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /srv/ckan/bin/activate
|
||||
paster --plugin=ckan tracking update -c /etc/ckan/ckan.ini && \
|
||||
paster --plugin=ckan search-index rebuild -r -c /etc/ckan/ckan.ini
|
||||
deactivate
|
||||
/srv/ckan/bin/paster --plugin=ckan tracking update -c /etc/ckan/ckan.ini && \
|
||||
/srv/ckan/bin/paster --plugin=ckan search-index rebuild -r -c /etc/ckan/ckan.ini
|
||||
|
Loading…
Reference in New Issue
Block a user