Skip to content

Instantly share code, notes, and snippets.

@thenets
Created November 21, 2017 03:22
Show Gist options
  • Save thenets/3653cd5ff5dc51d251c0f1ceaddea796 to your computer and use it in GitHub Desktop.
Save thenets/3653cd5ff5dc51d251c0f1ceaddea796 to your computer and use it in GitHub Desktop.
Instalador do ckanext-dadosgovbrschema para o EasyCKAN
echo ''
echo "# Installing ckanext-dadosgovbrschema"
echo "# ================================================================================"
echo ''
echo "# Create installer script for ckanext-dadosgovbrschema and install"
DADOSGOVBR_INSTALL='/usr/lib/ckan/default/src/dadosgovbr_install.sh'
DADOSGOVBR_SCHEMA_DIR='/usr/lib/ckan/default/src/ckanext-dadosgovbrschema'
echo "#!/bin/bash" > $DADOSGOVBR_INSTALL
echo "cd /usr/lib/ckan/default/src" >> $DADOSGOVBR_INSTALL
echo "pip install -e git+https://github.com/dadosgovbr/ckanext-dadosgovbrschema.git@master#egg=ckanext-dadosgovbrschema" >> $DADOSGOVBR_INSTALL
echo "pip install -r $DADOSGOVBR_SCHEMA_DIR/pip-requirements.txt" >> $DADOSGOVBR_INSTALL
echo "cd $DADOSGOVBR_SCHEMA_DIR && python setup.py develop" >> $DADOSGOVBR_INSTALL
chown 5000.5000 $DADOSGOVBR_INSTALL
chmod +x $DADOSGOVBR_INSTALL
easyckan exec $DADOSGOVBR_INSTALL
sed -i "s/dadosgovbrschema//g" /etc/ckan/default/development.ini
sed -i "s/ckan.plugins = /ckan.plugins = dadosgovbrschema /g" /etc/ckan/default/development.ini
echo ''
echo "# Setup repository ckanext-dadosgovbr for development"
chown 1000.1000 -R $DADOSGOVBR_SCHEMA_DIR
su $(id -nu 1000) -c "cd $DADOSGOVBR_SCHEMA_DIR && git remote remove origin"
su $(id -nu 1000) -c "cd $DADOSGOVBR_SCHEMA_DIR && git remote add origin [email protected]:dadosgovbr/ckanext-dadosgovbrschema.git"
ln -s $DADOSGOVBR_SCHEMA_DIR /home/$(id -nu 1000)/ckanext-dadosgovbrschema
echo ''
echo "# Restart all containers and setup production mode"
echo "# ================================================================================"
easyckan repair
easyckan production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment