Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENEUROPA-373: Implements command hooks #38

Closed
ademarco opened this issue Jan 15, 2018 · 1 comment
Closed

OPENEUROPA-373: Implements command hooks #38

ademarco opened this issue Jan 15, 2018 · 1 comment

Comments

@ademarco
Copy link
Member

ademarco commented Jan 15, 2018

We could easily provide pre and post command hooks based on naming conventions, just like what we currently do for drupal:site-install.

It would look like this:

Given I have a "my-custom:command"
And I add dynamic pre/post hooks as:
"""
hooks:
    my-custom:command:
        pre:
          - { task: "symlink", from: "../../../../..", to: "${drupal.root}/sites/all/themes/custom/ec_europa" }
          - { task: "run", command: "drupal:drush-setup" }
          - { task: "run", command: "drupal:settings-setup" }
        post:
          - "./vendor/bin/drush --root=$(pwd)/${drupal.root} cr"
"""
Then pre and post hooks are ran automatically before and after "my-custom:command"
And I can run the following commands via the command line:
"""
$ hooks:pre:my-custom:command
$ hooks:post:my-custom:command
"""

This should also work for non-custom commands.

@ademarco
Copy link
Member Author

Closing as this is now tracked by OPENEUROPA-373.

@ademarco ademarco changed the title Implements command hooks OPENEUROPA-373: Implements command hooks Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant