Remove hooks documentation.
@@ -235,44 +235,3 @@ There are a number of configuration options for how deploys are managed. These c
.. note::
When added to ``config.py`` (vs the deploy file), these options will take effect for any CLI usage (ie ``pyinfra host exec -- 'tail -f /var/log/syslog'``).
-
-
-Hooks
------
-
-Deploy hooks are executed by the CLI at various points during the deploy process. These can be defined in a ``config.py``:
-
-+ ``before_connect``
-+ ``before_facts``
-+ ``before_deploy``
-+ ``after_deploy``
-
-These can be used, for example, to check the right branch before connecting or to build some client-side assets locally before fact gathering. All hooks take ``(data, state)`` as arguments:
-
-.. code:: python
-
- # config.py
-
- from pyinfra import hook
-
- @hook.before_connect
- def my_callback(data, state):
- print('Before connect hook!')
-
-To abort a deploy, a hook can raise a ``hook.Error`` which the CLI will handle.
-
-When executing commands locally inside a hook (i.e. ``webpack build``), you should always use the ``pyinfra.local`` module:
-
-.. code:: python
-
- @hook.before_connect
- def my_callback(data, state):
- # Check something local is correct, etc
- branch = local.shell('git rev-parse --abbrev-ref HEAD')
- app_branch = data.app_branch
-
- if branch != app_branch:
- # Raise hook.Error for pyinfra to handle
- raise hook.Error('We\'re on the wrong branch (want {0}, got {1})!'.format(
- branch, app_branch
- ))
