#!/bin/bash
echo "Executing build for upgrade"
echo ""
echo "Registry rebuild"
drush rr
echo ""
# You can run this script with the argument dev.
dev_setup=false
if [[ $# -eq 1 ]]; then
if [[ $1 = "dev" ]]; then
dev_setup=true
fi
fi
if $dev_setup ; then
echo "Build script for development"
echo ""
# Disable modules here.
fi
echo "Running any required database updates"
drush updb -y
echo ""
# Clear the cache.
echo "Clearing cache"
drush cc all
echo ""
# Revert features
echo "Reverting all features"
drush fra -y
echo ""
# Clear the cache.
echo "Clearing cache"
drush cc all
if $dev_setup ; then
echo "Dev: create user admin"
drush user-create prometadmin --mail="admin@webizat.com" --password="admin"
echo "Dev: add role admin to admin"
drush user-add-role "administrator" admin
else
# Index the nodes in Solr (Uncomment next line when ready)
# drush solr-index
fi
# Clear the cache
echo "Clearing cache one last time"
drush cc all
echo ""
echo ""
echo "Build completed"
if $dev_setup ; then
echo "Dev: your connexion token as admin"
drush uli admin
fi