triggers.adoc 801 B

12345678910111213141516171819202122232425
  1. [#triggers]
  2. = Triggers
  3. Sometimes you want to trigger another action after the first one completes. This is mostly useful for updating hidden actions that update entity files, without having to run those updates on a cron job every 10 seconds!
  4. NOTE: OliveTin used to support a single action trigger, but now supports multiple triggers. The field `trigger` was renamed to `triggers` and is now an array of triggers.
  5. [source,yaml]
  6. ----
  7. entities:
  8. - file: /etc/OliveTin/entities/containers.json
  9. name: container
  10. actions:
  11. - title: stop {{ container.Names }}
  12. shell: docker stop {{ container.Names}}
  13. entity: container
  14. triggers:
  15. - update containers
  16. - title: update containers
  17. shell: docker ps -a --format=json > /etc/OliveTin/entities/containers.json
  18. hidden: true
  19. ----