Drupal 8 deploy commands

What to execute when deploy Drupal 8 project

This page will help you to know what to kind of commands that you can put in the list of your deploy commands:

// Install composer required libraries.
composer install
// Import configurations using (sync) or (production) configurations.
// (You have to define these types in $config_directories settings.php).
// drush config-import production
drush config-import sync
// Update locale files.
drush locale-check && drush locale-update && drush cr


These commands below should not be in the deploy commands but you may want to execute them once.
// Sometime you may want to set the site ID using this command so we can import config:
drush cset system.site uuid SITE_UUID_HERE
// In order to make sure to set some of the variables you may want to set some variables
// per environment.
drupal state:override SOME_VARIABLE_NAME
// And the value of this variable will be specifically for a specific environment.
// Deploy
echo "██████ DEPLOY"
cd /var/www/html
// #git checkout composer.json
echo "Pulling changes from git repo .."
git pull
echo "Installing composer .."
composer install --no-interaction
./vendor/bin/drush cim -y
./vendor/bin/drush cim -y
./vendor/bin/drush locale-check
./vendor/bin/drush locale-update
./vendor/bin/drush cr
chown www-data:www-data -R /var/www/html


// Multiple hosts deploy command // #/bin/sh echo "██████ DEPLOY" cd /var/www/html/$1 git checkout composer.json echo "Pulling changes from git repo .." git pull echo "Installing composer .." composer install ./vendor/bin/drush cim -y ./vendor/bin/drush cim -y ./vendor/bin/drush locale-check ./vendor/bin/drush locale-update ./vendor/bin/drush cr chown www-data:www-data -R /var/www/html/$1

// 20221111
// Check the platform requirements before continue the deployment
composer check-platform-reqs

Bluetooth issue:

sudo sed -i 's/#IdleTimeout=30/IdleTimeout=0/g' /etc/bluetooth/input.conf

// 20230507 one deployment script for staging sites

/bin/sh

echo "██████ START THE BUILD" cd /var/www/html/$1 git status git checkout composer.json echo "Pulling changes from git repo .." git pull echo "Installing composer .." composer install --no-interaction --no-dev chown www-data:www-data -R /var/www/html/$1

echo "██████ DEPLOY" echo "Import configurations .." composer install --no-interaction --no-dev ./vendor/bin/drush cr ./vendor/bin/drush cim -y ./vendor/bin/drush cim -y ./vendor/bin/drush locale-check ./vendor/bin/drush locale-update ./vendor/bin/drush updb -y ./vendor/bin/drush cr

فضلاً إذا أعجبتك هذه الصفحة لاتنسى أن تقوم بمشاركتها