triggers.adoc 1.1 KB

1234567891011121314151617181920212223242526
  1. [#triggers]
  2. = Triggers
  3. Sometimes you want to trigger another action after the first one completes. This is mostly useful for updating xref:action_customization/hidden.adoc[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. ----
  20. IMPORTANT: `hidden` only removes the action from automatic dashboard listings. It is not a security control — use xref:security/acl.adoc[ACLs] to restrict who can view or execute an action. See xref:action_customization/hidden.adoc[Hidden actions].