drevops / vortex

🌀 Drupal project template
https://vortex.drevops.com
GNU General Public License v3.0
82 stars 18 forks source link

Add support for pre- and post- hooks in scripts #1198

Open AlexSkrypnyk opened 7 months ago

AlexSkrypnyk commented 7 months ago

Allow to run custom scripts before and after scripts operations.

  1. Need to assess and identify which DrevOps scripts needs this.
  2. Need to come up with a short code snippet to handle this. Desirably to make the inclusion script to use the current script name as a base.
  3. The hook script should be able to suspend the main script execution

Examples:

sctipts/drevops/provision.sh would automatically discover:

scripts/hooks/pre-provision.sh
scripts/hooks/pre-provision-10.sh
scripts/hooks/pre-provision-20.sh
scripts/hooks/pre-provision-30.sh

and

scripts/hooks/post-provision.sh
scripts/hooks/post-provision-10.sh
scripts/hooks/post-provision-20.sh
scripts/hooks/post-provision-30.sh

The scripts/hooks directory may be something different: scripts/hooks scripts/custom scripts

AlexSkrypnyk commented 6 months ago

@sonnykt @richardgaunt Could you please review the above and put your ideas around naming and the usefulness of this feature.