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

Deploy Hooks: use task files #378

Merged
merged 1 commit into from
Oct 9, 2015
Merged

Deploy Hooks: use task files #378

merged 1 commit into from
Oct 9, 2015

Conversation

swalkinshaw
Copy link
Member

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.

@swalkinshaw
Copy link
Member Author

Original: #320

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.
swalkinshaw added a commit that referenced this pull request Oct 9, 2015
Deploy Hooks: use task files
@swalkinshaw swalkinshaw merged commit 124dbc7 into master Oct 9, 2015
@swalkinshaw swalkinshaw deleted the deploy-hooks branch October 9, 2015 22:53
This was referenced Oct 14, 2015
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

Successfully merging this pull request may close these issues.

1 participant