-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Deploy command hooks #305
Comments
That is an excellent Idea. Moreover, Quick example from the docs: |
Wow that's hilarious. They even named the dir |
This implements proper hook files with Ansible tasks as discussed in #305. This feature is heavily borrowed/stolen from https://github.com/f500/ansible-project_deploy with a few differences. This PR separates outs the `main.yml` tasks file into multiple files. Each file represents a "step" in the deploy flow. And for each step we have `before` and `after` hooks available. The steps are: 1. `initialize` 2. `update` 3. `prepare` 4. `build` 5. `share` 6. `finalize` Also note that technically the `after` hook of one step and the `before` hook of the following step are the same. However I wanted to include the `before`/`after` nomenclature for semantic reasons mostly. Also so it's more obvious *when* the hook is run. The f500 project uses hooks like `project_deploy_hook_on_initialize` which, in my opinion, could be a little confusing as to where/when exactly it's happening. Hooks available: * `deploy_initialize_before` * `deploy_initialize_after` * `deploy_update_before` * `deploy_update_after` * `deploy_prepare_before` * `deploy_prepare_after` * `deploy_build_before` * `deploy_build_after` * `deploy_share_before` * `deploy_share_after` * `deploy_finalize_before` * `deploy_finalize_after` Those are all variables which can be defined to override the default. Right now only `deploy_build_after` and `deploy_finalize_after` have corresponding hook files to replicate functionality we previously had in the commands.
Fixed by #378 |
Right now our deploy command "hooks" are limited to strings that get passed into the
command
orshell
module. This means we can't really take advantage of Ansible modules at all.This leads to issues like #282 with non-ideal solutions.
Instead we could include task files for each hook:
/cc @cfxd @louim @fullyint
The text was updated successfully, but these errors were encountered: