Files
debian-web-server/assets/deploy-drupal.sh
T

45 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# https://chromatichq.com/blog/drupal-8-deployments-jenkins-github-slack
CYAN='\033[1;36m'
GREEN='\033[1;32m'
RESET='\033[0m'
step() {
echo -e "\n${CYAN}==================================================${RESET}"
echo -e "${CYAN} $1${RESET}"
echo -e "${CYAN}==================================================${RESET}\n"
}
step "Updating Drupal 8"
echo "Switching to project docroot."
cd ./public_html
step "Pulling down latest code"
git pull --ff-only origin prod
git submodule update --init --recursive
step "Clearing drush caches"
vendor/bin/drush cache-clear drush --ansi
step "Composer install"
composer install --no-dev -n --ansi
step "Running database updates"
vendor/bin/drush updb -y --ansi
step "Importing configuration"
vendor/bin/drush config-import -y --ansi
#drush csim prod -y
vendor/bin/drush im --choice safe --ansi
vendor/bin/drush ib --choice full --ansi
step "Regen path aliases"
#drush pag all canonical_entities:node
#drush pag all canonical_entities:taxonomy_term
step "Clearing caches"
vendor/bin/drush cr --ansi
echo -e "\n${GREEN}Deployment complete.${RESET}\n"