keyboardcowboy / drush-denver
Customize modules, variables and permissions for each environment.
Installs: 756
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 4
Type:drupal-drush
Requires
- php: >=5.4.0
- composer/installers: ~1.0
- symfony/yaml: ^2.0 || ^3.0
README
The Drupal ENVironemnt personalizER allows you to define macro settings to apply to your site in one command, such as enabling and disabling modules and setting variables.
Installation
Extract this repository into any of Drush's searchable paths for plugins:
-
A
.drush
folder in your HOME folder. -
Anywhere in a folder tree below an active module on your site.
-
/usr/share/drush/commands
(configurable) -
In an arbitrary folder specified with the
--include
option. -
Drupal's
/drush
or/sites/all/drush
folders.
See drush topic docs-commands
for more details
Configuration
These can be defined in two different files and only apply to the site directory in which they are defined.
-
sites/[default|example.com]/drush/env.drushrc.yml
-
sites/[default|example.com]/drush/[dev.]env.drushrc.yml
Like aliases, in the first file you can define multiple aliases keyed on the definition name such as 'dev,' 'stage' or 'chris.' In the second example you can define each environment in a separate file and prefix the filename with the definition name.
The definitions are formatted as such: # Settings for your local environment. modules: enable: - module_name disable: - module_name
variables:
your_var: your_var_value
another_var: NULL
permissions:
RoleName:
permission_name: 0
commands:
# Using longhand notation.
command-name:
alias: @self
arguments:
arg1: arg1-val
options:
opt1: opt1-val
# Using shorthand notation.
command-name:
- yes
- arg1
- arg2
- --option1
How to Use It
You must be inside a Drupal site directory or use an alias for these commands to work.
-
Create a starter file
drush env-dir --make
-
See which environments are available.
drush env
drush env-list
-
Inspect the contents of an environment definition.
drush env [en-name] --info
Ex.
drush env dev --info
-
Run the environment settings for a single definition.
drush env [env-name]
Ex.
drush env dev
-
Combine multiple environments. The settings for the latter overriding the former.
drush env [env-name1]+[env-name2]
Ex.
drush env dev+chris