fixed mysql_secure_installation par mariadb-secure-installation; improved deploy-drupal.sh

This commit is contained in:
2026-09-25 11:54:41 +02:00
parent 2e3ec7883f
commit 8ea1a19c32
2 changed files with 39 additions and 21 deletions
+38 -20
View File
@@ -1,26 +1,44 @@
#!/bin/bash #!/bin/bash
# https://chromatichq.com/blog/drupal-8-deployments-jenkins-github-slack
echo "updating drupal" 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." echo "Switching to project docroot."
cd ./public_html cd ./public_html
echo ""
echo "Pulling down latest code." step "Pulling down latest code"
git pull --ff-only origin prod git pull --ff-only origin prod
git submodule update --init --recursive git submodule update --init --recursive
echo ""
echo "Clearing drush caches." step "Clearing drush caches"
vendor/bin/drush cache-clear drush vendor/bin/drush cache-clear drush --ansi
echo ""
echo "Composer install." step "Composer install"
composer install --no-dev composer install --no-dev -n --ansi
echo ""
echo "Running database updates." step "Running database updates"
vendor/bin/drush updb -y vendor/bin/drush updb -y --ansi
echo ""
echo "Importing configuration." step "Importing configuration"
vendor/bin/drush config-import -y vendor/bin/drush config-import -y --ansi
echo "" #drush csim prod -y
echo "Clearing caches." vendor/bin/drush im --choice safe --ansi
vendor/bin/drush cr vendor/bin/drush ib --choice full --ansi
echo ""
echo "Deployment complete." 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"
+1 -1
View File
@@ -130,7 +130,7 @@ if [ "$installmysql" = "yes" ]; then
printf "\033[35;1minstalling Mysql \033[0m\n" printf "\033[35;1minstalling Mysql \033[0m\n"
sleep 3 sleep 3
apt-get --yes install mariadb-server apt-get --yes install mariadb-server
mysql_secure_installation mariadb-secure-installation
cp "$_assets"/mysql/innodb-file-per-table.cnf /etc/mysql/conf.d/ cp "$_assets"/mysql/innodb-file-per-table.cnf /etc/mysql/conf.d/