It's a starting point for a new Drupal 8 project. Drupal Go will automatically prepare a local development environment and install Drupal project using best practices. Also, it supplies a number of useful tools/commands/aliases you can work with.
The Drupal Go based on Composer template for Drupal project, Robo and docker4drupal.
- Prepare the development environment based on docker4drupal
- Prepare the project folder structure based on best practices form Composer template for Drupal project.
- Automatically installs a drupal Project based on custom configurations.
- Provides useful tools and commands.
- Generates drush aliases and applies correct adjustments for drush configurations.
- To avoid incompatibilities please make sure that your port
80is available and all other docker environments on your local machine are stopped. Or rundocker container stop $(docker ps -aq) - In your project root directory (
wwwfor example) rungit clone git@github.com:nortmas/drupal-go.git <project-machine-name> && cd <project-machine-name> && rm -r .git. (NOTE: For the sake of consistency, name your project directory as a project machine name.) - If it's your first project with Drupal GO, for the convenience you may set the aliases (highly recommended):
mkdir ~/.dgo && cp $(pwd)/go/scripts/aliases.sh ~/.dgo/aliases.sh- Now add this line
source ~/.dgo/aliases.shto yourbashrcorbash_profileorzshrcfile. - Restart your cli. To restart zsh:
exec zsh, to restart bash:exec bash -l.
- Check the latest tags for the docker images in the docker4drupal.
- Set the configurations and choose the modules you want to install in the file
GoConfig.php. - Run
make go_linORmake go_mac, depends on what OS are you using. - Run next commands one by one:
make go_prepare_envmake go_drupal_install
- Add lines to the
composer.jsonin thedrupal-scaffold/file-mappingsection:"[web-root]/robots.txt": false"[web-root]/.htaccess": false"[project-root]/.editorconfig": false
- Go to the
/admin/reports/statuspage and check errors. Perhaps you need to install some missing libraries.
If you want to improve performance, please read the doc.
- Get into the project directory:
cd <project-machine-name> - Do the steps 1,3,6 from the Installation section above.
- Run the environment:
make go_up. - Install the dependencies:
goc install. - Import database dump:
gor dbiif you have a dump file./db/default_[date].sql.gz. - Implement general rebuild:
gor rebuild.
- URL: https://
<project_machine_name>.docker.localhost - User:
admin - Password:
GoIn2house!
- If you need specific settings for your local environment, use the
docker-compose.override.ymlfile. - You can use
MakefileandRoboFile.phpto extend workflow with the project specific commands.
god- Run drush in the php container.godr- Run drupal in the php container.gor- Run robo in the php container.goс- Run composer in the php container.
project_name- Will be used for the drupal site name and composer.json project name.project_machine_name- Will be used for different needs to unify some configurations also will be used as a url prefix.multisite- You can specify the array of needed domains to create the folder structure automatically.deploy- Configure GitLab CI files and deployment flow.server- Configure remote server that will contain dev, stage and master (prod) environments.behat- Used for Behat configuration files.admin_theme- Determinate what contrib admin theme to enable.modules- Determinate what contrib modules to enable.submodules_to_enable- Determinate what submodules to enable.- All other configurations are related to the docker4drupal
FYI: If you set memcached to be enabled, it will also enable memcache drupal module and implement appropriate configurations.
make go_prepare_env- Roll out the environment.make go_drupal_install- Install Drupal.make go_mac- Create .env file with specific settings for Mac.make go_lin- Create .env file with specific settings for Linux.make go_run_behat- Run behat tests.make go_drupal_update- Update Drupal core with dependencies.make go_update_translations- Update Drupal translations.make go_code_sniff- Check codebase with phpcs sniffers to make sure it conforms https://www.drupal.org/docs/develop/standardsmake go_code_fix- Fix codebase according to Drupal standards https://www.drupal.org/docs/develop/standardsmake go_up- Up the docker containers.make go_down- Stop and remove the docker containers and networks.make go_restart- Restart containers.make go_reset_structure- Reset file/directory structure to the initial Drupal Go state.make go_sh- Get into the php container.make help- Shows info about all available make commands.
robo db_export, aliasdbe. Implement an export of current DB state to the DB folder.robo db_import, aliasdbi. Implement an import of latest DB dump from the DB folder.filenameargument is optional to restore the particular dump.robo get_db, aliasgdb. Import DB from the specified environment. It requires argumentalias(dev,stage or prod)robo get_files, aliasgf. Import files from the specified environment. It requires argumentalias(dev,stage or prod)robo rebuildExecute necessary actions after a pull from the repository.robo set_correct_file_permissions, aliasscfp. Set correct file permissions according to the official documentation recommendations.robo set_settings_writable, aliasssw. Set writable permissions for settings files.robo multisiteGenerate directory structure and necessary configuration files for specified domains.robo behat_setupSet up behat auto tests.robo reconfReconfigure settings for the particular set of files. May accept arguments:drupal,drush,docker,gitlab,behat,phpunit.default(by default) includes drupal, drush, docker))robo deploy_setupSet up the deployment flow.robo container_add, aliascta. Argumentcontainer_name(See Available extra containers section). Add container to the docker-compose.override.ymlrobo container_remove, aliasctr. Argumentcontainer_name(See Available extra containers section). Remove container from the docker-compose.override.yml
mailhogvarnishadminerseleniumpmasolrredisnodersyslogathenapdfwebgrindblackfireemulsifyxdebug
If you need to apply patches (depending on the project being modified, a pull request is often a better solution), you can do so with the composer-patches plugin.
To add a patch to drupal module foobar insert the patches section in the extra section of composer.json:
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL to patch"
}
}
}