Skip to content

Instantly share code, notes, and snippets.

@ainsofs
Last active March 4, 2025 03:17
Show Gist options
  • Save ainsofs/d45fa6b54ec4675ade257d993b5f8281 to your computer and use it in GitHub Desktop.
Save ainsofs/d45fa6b54ec4675ade257d993b5f8281 to your computer and use it in GitHub Desktop.
Composer helper scripts for Drupal
"scripts": {
"build": [
"drush site:install minimal --existing-config --db-url=mysql://root:password@mariadb:3306/drupal -y",
"drush cr"
],
"build2": [
"drush site:install --existing-config --db-url=mysql://root:password@mariadb:3306/drupal -y",
"drush cr"
],
"build3": [
"@generate_salt",
"drush si -y",
"drush cset system.site uuid \"5bb79423-cfb5-4dd1-98fc-1efb2a54c645\" -y",
"drush entity:delete shortcut_set",
"drush cim -y",
"drush php-eval 'node_access_rebuild();'"
],
"drupal:update": [
"composer update drupal/core* -W",
"drush cr",
"drush updb -y",
"drush cex -y"
],
"php_compatibility": [
"phpcs -p --standard=PHPCompatibility --extensions=php,inc,module,install --runtime-set testVersion 8.2 /var/www/html/drupal/web/modules/custom",
"phpcs -p --standard=PHPCompatibility --extensions=php,inc,theme,install --runtime-set testVersion 8.2 /var/www/html/drupal/web/themes/custom"
],
"coding_standards": [
"phpcs --standard=Drupal --extensions=php,module,inc,install /var/www/html/drupal/web/modules/custom",
"phpcs --standard=Drupal /var/www/html/drupal/web/themes/custom --ignore=*/node_modules/*,*.css,*.js,includes/*"
],
"coding_standards_fix": [
"phpcbf --report=diff --extensions=php,module,inc,install --standard=Drupal /var/www/html/drupal/web/modules/custom",
"phpcbf --report=diff --standard=Drupal /var/www/html/drupal/web/themes/custom --ignore=*/node_modules/*,*.css,*.js,includes/*"
],
"drupal_check": [
"drupal-check /var/www/html/drupal/web/*/custom"
],
"generate_salt": [
"drush php-eval 'echo \\Drupal\\Component\\Utility\\Crypt::randomBytesBase64(55)' > salt.txt"
],
}
@ainsofs
Copy link
Author

ainsofs commented Mar 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment