Command Line Cheat Sheet - NCIOCPL/cgov-digital-platform GitHub Wiki

Some useful commands

Outside the container

Install packages

composer install

Reinstall packages

composer cgov-clean
composer install

Add a new package

composer require <package_name>[:<version>]

Add a new drupal module

composer require drupal/<module_name>[:<version>]

Hints on why composer wouldn't add a package

composer why-not <package_name>[:<version>]

Within the web container

Create a one-use login link

drush uli

Create an admin user

drush ucrt [my_user_name]
drush upwd [my_user_name] [my_password]
drush urol administrator [my_user_name]

Reinstall Drupal with "ODE" Content

blt cgov:reinstall --no-interaction

Rebuild the front-end CSS/JS for both cgov_common and ncids_trans themes

blt cgov:rebuild-feq --no-interaction

Rebuild the front-end for the ncids_trans

The can save time from the above if you don't need to make sure cgov_common builds too.

cd /var/www/docroot/profiles/custom/cgov_site/themes/custom/ncids_trans/front-end
npm ci
npm run build:prod

Import dummy content

drush ycim cgov_yaml_content

Import a single piece of content

drush yci /var/www/docroot/profiles/custom/cgov_site/modules/custom/cgov_yaml_content <WORDS_LEFT_OF_.content.yaml>

Do NOT include the ".content.yml" portion.
e.g. drush yci /var/www/docroot/profiles/custom/cgov_site/modules/custom/cgov_yaml_content 200_blog-series

Begin Pending Update

blt cgov:install:site-sections
drush ycim cgov_yaml_content

OR

blt cgov:yaml:load

End Pending Update

Export configuration

drupal config:export --directory="../files-private/DIRECTORY_NAME" --remove-uuid --remove-config-hash
⚠️ **GitHub.com Fallback** ⚠️