feat: add porcelain output
This PR adds the --porcelain flag to help with using watchtower in scripts. When set, it uses a built-in template (porcelain.v1.summary-no-log) and writes notifications to stdout.
The output is meant to be stable and easily processed by common scripting tools like awk etc.
Versioning of the templates, even though it's generally a good idea, might be overkill for this?
If we want to keep them, we should make --porcelain take the version as an argument, like --porcelain v1, that way we can add newer versions of templates without breaking scripts.
Fixes #1336
Codecov Report
Merging #1337 (5fa306a) into main (08831f7) will increase coverage by
0.51%. The diff coverage is80.64%.
@@ Coverage Diff @@
## main #1337 +/- ##
==========================================
+ Coverage 63.82% 64.33% +0.51%
==========================================
Files 23 23
Lines 1534 1598 +64
==========================================
+ Hits 979 1028 +49
- Misses 465 473 +8
- Partials 90 97 +7
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/notifications/email.go | 90.69% <ø> (ø) |
|
| pkg/notifications/notifier.go | 85.13% <75.00%> (+0.20%) |
:arrow_up: |
| pkg/notifications/shoutrrr.go | 73.33% <80.00%> (-1.37%) |
:arrow_down: |
| internal/flags/flags.go | 87.56% <80.95%> (-1.56%) |
:arrow_down: |
| pkg/notifications/slack.go | 95.12% <100.00%> (+0.25%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.