Skip to content

Post installation

Matt Poole edited this page Jul 16, 2024 · 3 revisions

Additional Commands

After you have installed and configured Drupal Env and at least one local, there are some handy commands if you'd like to further configure your environment

Will run all the commands again: ./robo.sh common-admin:init

These two are already called after you install a local, because they require a local to be running:

  • Prompt to install helpful Drupal modules: ./robo.sh common-admin:optional-dependencies
  • Allow you to choose theme and admin theme: ./robo.sh common-admin:theme-set

Choose another local environment: ./robo.sh common-admin:local

Choose a remote environment: ./robo.sh common-admin:local

Update Dependencies

This project uses core-composer-scaffolding in order to write the majority of the code to your code base. This is done so that it can place files where they need to be instead of just vendor. This is done by running the composer scaffold command that is run after any dependency changes. However, because of order of operations issues, we disabled Drupal core from being scaffolded automatically in this way. This means that every time you update Drupal core or any of the Drupal Env packages, that you have to take an extra step to ensure you have the latest. For example:

This will update all your dependencies then run scaffolding for both Drupal core and Drupal env: composer update && ./robo.sh drupal-env:scaffold-all

You'll note that if you've made any changes to scaffolded files, those will now show up as a Git modification. That's why it's important that if you change the scaffolding, that you call out (add comments) those places so you know which are changes you want to accept versus changes you want to revert. Note: Instead of modifying scaffolded files directly, you can append or patch them. This might be more work to setup but will save time in confusion later.

Here is an example set of commands to update dependencies:

  • Optionally save your work: git stash
  • Checkout the branch that the next release will be cut from: git checkout develop && git reset --hard origin/develop
  • Checkout a feature branch
  • Install Drupal from configuration: lando si or ./drush.sh si
  • Ensure your config is valid (if this exports config, you may need to troubleshoot what's going on): drush cex -y
  • Update dependencies: ./composer.sh update
  • Run updates: ./drush.sh updb -y
  • Export any config changed by updb: ./drush.sh cex -y
  • Commit any config changes and a single new entry: composer.log
  • Re-run scaffolding: ./robo.sh drupal-env:scaffold-all
  • Revert any manually changes scaffolded files and commit any other changes to scaffolding (BE EXTRA CAUTIOUS ABOUT .gitignore, that can really get messed up)

Working with scaffolded files

core-composer-scaffolding provides many approaches if you want to change how the scaffolding works. Besides what was referenced above about altering scaffolded files, you can also define your own or exclude specific files from being scaffolded.

Clone this wiki locally