This is an experimental command and is likely subject to change in the future.
trigger command forcibly marks a stack as "changed" even if it doesn't contain any code changes according to the change detection. It does this by creating a file (by default in
/.tmtriggers) which should then be committed.
terramate run will then execute commands against any stacks that have been triggered in the last commit (as well as any other changed stacks).
The trigger mechanism has various use cases. It may be that a previous CI/CD run failed or that you have detected drift between the code and the actual state. For those using Terramate Cloud, the additional
--cloud-status=<status> argument can be used to trigger stacks that are in one of the following states:
|The stack is not drifted and the last deployment succeeded
|The last deployment of the stack failed so the status is unknown
|The actual state is different from that defined in the code of the stack
|This meta state matches any undesirable state (failed, drifted etc)
|This meta state matches stacks that have no undesireable state
terramate experimental trigger PATH
Create a change trigger for a stack:
terramate experimental trigger /path/to/stack
Create triggers for all stacks that have drifted
terramate experimental trigger --cloud-status=drifted