27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
[#triggers]
|
|
= Triggers
|
|
|
|
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!
|
|
|
|
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.
|
|
|
|
[source,yaml]
|
|
----
|
|
entities:
|
|
- file: /etc/OliveTin/entities/containers.json
|
|
name: container
|
|
|
|
actions:
|
|
- title: stop {{ container.Names }}
|
|
shell: docker stop {{ container.Names}}
|
|
entity: container
|
|
triggers:
|
|
- update containers
|
|
|
|
- title: update containers
|
|
shell: docker ps -a --format=json > /etc/OliveTin/entities/containers.json
|
|
hidden: true
|
|
----
|
|
|
|
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].
|