Add context for various hooks. #469

Merged
witten merged 2 commits from cyfdecyf/borgmatic:master into master 5 months ago

Variables like repository are not interpolated in hook command which is a little surprise to me, thus made this PR.

Variables like `repository` are not interpolated in hook command which is a little surprise to me, thus made this PR.
cyfdecyf added 1 commit 9 months ago
091c07bbe2 Add context for various hooks.
cyfdecyf added 1 commit 9 months ago
0014b149f8 remove configuration_filename as it's already set.
Owner

Thanks for taking the time to make this PR! Could you describe your use case for this? This "repository" variable looks like it can sometimes contain multiple repositories, which might be a little unexpected given that the behavior is different from the on_error hook. In general I'm happy to expand the interpolated variables.. I just want to make sure I understand how they might be consumed in downstream scripts. Appreciate it!

Thanks for taking the time to make this PR! Could you describe your use case for this? This "repository" variable looks like it can sometimes contain multiple repositories, which might be a little unexpected given that the behavior is different from the `on_error` hook. In general I'm happy to expand the interpolated variables.. I just want to make sure I understand how they might be consumed in downstream scripts. Appreciate it!
Poster

My use case is simple. I didn't use any of the monitoring service supported by borgmatic, so I want to send notification for backup start and finish by myself.

My use case is simple. I didn't use any of the monitoring service supported by borgmatic, so I want to send notification for backup start and finish by myself.
Owner

Sorry for the delay here! I'm merging this now, but just a heads up that I'm renaming the context variable to repositories since it can contain more than one! Thanks.

Sorry for the delay here! I'm merging this now, but just a heads up that I'm renaming the context variable to `repositories` since it can contain more than one! Thanks.
witten merged commit 6b500c2a8b into master 5 months ago
Owner

Released in borgmatic 1.5.24.

Released in borgmatic 1.5.24.
Owner

Another heads up: I'm renaming the context variable back to repository in borgmatic 1.6.0 (to be released). This is because #473 changes command hooks to be called on a per-repository basis. The existing repositories context variable should continue to work, however.. It will just be deprecated.

Another heads up: I'm renaming the context variable back to `repository` in borgmatic 1.6.0 (to be released). This is because #473 changes command hooks to be called on a per-repository basis. The existing `repositories` context variable should continue to work, however.. It will just be deprecated.
continuous-integration/drone/pr Build is passing
The pull request has been merged as 6b500c2a8b.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#469
Loading…
There is no content yet.