Deployment hooksΒΆ

Tsuru provides some deployment hooks, like restart:before and restart:after. Deployment hooks allow developers to run commands before and after some commands.

Hooks are listed in a special file located in the root of the application. The name of the file may be app.yaml or app.yml. Here is an example of the file:

hooks:
  restart:
    before:
      - python manage.py collectstatic --noinput
      - python manage.py compress
    before-each:
      - python manage.py generate_local_file
    after-each:
      - python manage.py clear_local_cache
    after:
      - python manage.py clear_redis_cache

Currently, Tsuru supports the following restart hooks: