Hero image for: Try Drupal 8.5 and umami profile using one command

Try Drupal 8.5 and umami profile using one command

By Jesus Manuel Olivas ● Co-founder of Octahedroid and Blaze CMS | February 19th, 2018

If you are following the upcoming release of Drupal 8.5 you might be aware of the umami profile. This installation profile is part of the Out of The Box experience initiative. The goal of this profile is to add sample content presented in a well-designed theme, displayed as a food magazine. Using recipes and feature articles this example site will make Drupal look much better right from the start and help evaluators explore core Drupal concepts like content types, fields, blocks, views, taxonomy, etc.

This profile is committed to the 8.5 branch of the Drupal project repository which makes it a little complicated to try out. To facilitate this I wrote a chain command.

# Requires
# - DrupalConsole Launcher
# - Git
# - Composer
# - Sqlite
# How to use:
# copy the content of this gist to a new file name it as ~/.console/chain/try-umami-sqlite.yml
# Execution:
# drupal try:umami:sqlite --directory=/path/to/install/umami/
# NOTE: Use a full path for directory. Relative paths and `~` character are not allowed.
name: try:umami:sqlite
description: 'Download Drupal 8.5.x and install umami profile using sqlite'
# Clone Drupal 8.5.x
- command: exec
bin: git clone --branch 8.5.x https://git.drupal.org/project/drupal.git {{ directory }}
# Download Drupal Console
- command: exec
bin: composer require drupal/console:~1.0 --working-dir={{ directory }}
# Install Drupal
- command: exec
bin: drupal site:install demo_umami --root={{directory}} --db-type="sqlite" --no-interaction
# Start PHP built-in server
- command: exec
bin: drupal server --root={{directory}}
view raw try-umami-sqlite.yml hosted with ❤ by GitHub

You may think this looks cool but wait ... what this YAML means and what is a chain command?

A chain command is a custom command that helps you automate multiple command execution, allowing you to define and read an external YAML file containing the definition name, options, and arguments of multiple commands and execute that list based on the sequence defined in the file.

For more information about chain commands refer to the Drupal Console documentation.

How do I try this chain command?

In order to try this chain command it is required to have installed on your local system:

What do I need to do?

Copy the content of this gist file to a new file and name it as ~/.console/chain/try-umami-sqlite.yml

How do I execute the new command?

After adding the new file, the try:umami:sqlite command will be listed when running the list command. Then you have to execute the command on your local machine

Executing using the interactive mode and answering the interactive question:

drupal try:umami:sqlite

Enter the value for "directory" placeholder:

> /path/to/install/umami/

Executing the command inline and entering the directory where Drupal will be cloned and installed.

drupal try:umami:sqlite --directory=/path/to/install/umami/

Can I use another database as MariaDB, MySQL or other?

Yes, you can. But modifying the downloaded chain file will be required as updating the db-type='mysql' and passing the required options. To review all of the available options for the "site:install" command you can read the DrupalConsole documentation.

Related Posts