Deployment hooksΒΆ

Tsuru provides some deployment hooks, like restart:before, restart:after and build. 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 migrate
    before-each:
      - python manage.py generate_local_file
    after-each:
      - python manage.py clear_local_cache
    after:
      - python manage.py clear_redis_cache
  build:
    - python manage.py collectstatic --noinput
    - python manage.py compress

Tsuru supports the following hooks: