build/post_install.sh
author ymh <ymh.work@gmail.com>
Mon, 13 Feb 2017 17:13:11 +0100
changeset 507 a56a807f5d8e
parent 412 c88746153ee0
child 541 e756a8c72c3d
permissions -rw-r--r--
Added tag 0.0.15 for changeset 9a7fea1642cc

#!/usr/bin/env sh
PATH=/opt/remi/php56/root/usr/bin/:$PATH

if [ -x /usr/local/bin/drush ]; then
    echo "Reactivate corpus module"
    /usr/local/bin/drush -r /var/www/corpusdelaparole/drupal pm-enable -y corpus
    echo "Clear drupal cache"
    /usr/local/bin/drush -r /var/www/corpusdelaparole/drupal cc all
fi


if [ -d /var/www/corpusdelaparole/corpus-back/ ]; then
    pushd /var/www/corpusdelaparole/corpus-back/  > /dev/null

    echo "Correcting file permissions for back office"
    chgrp -R apache storage bootstrap/cache
    chmod -R ug+rwx storage bootstrap/cache

    echo "Migrating back office database"
    php artisan migrate -n --force

    echo "Optimizing framework"
    php artisan optimize
    php artisan config:cache
    php artisan route:cache

    echo "Correcting file permissions for back office"
    chgrp -R apache storage bootstrap/cache
    chmod -R ug+rwx storage bootstrap/cache

    echo "Put back application in production"
    php artisan up

    popd  > /dev/null
fi


echo "Restart httpd"
/usr/bin/systemctl restart httpd