Add option to return an exit-code when occ status signals an update is needed#35873
Add option to return an exit-code when occ status signals an update is needed#35873nickvergessen merged 3 commits intonextcloud:masterfrom
Conversation
nickvergessen
left a comment
There was a problem hiding this comment.
Otherwise you would need to add a tab on each line
54853d0 to
b99c041
Compare
|
@leegarrett Code style checker still complains, this time about empty lines and spacing: https://github.com/nextcloud/server/actions/runs/3824719618/jobs/6507559027 Also for the comments I’d prefer if you avoid using |
|
Also last commit is missing signoff and DCO complains: https://github.com/nextcloud/server/pull/35873/checks?check_run_id=10400685089 |
Running `./occ status -e` will produce any output. However, it will: exit 0 during normal operation, exit 1 when in maintenance mode, exit 2 when `./occ upgrade` is needed. Signed-off-by: Lee Garrett <lgarrett@rocketjump.eu>
5087f3a to
fba906e
Compare
I've hopefully fixed the issue now. Since the 2nd commit wasn't signed off, I've now just squashed it with the first, removed the extra whitespace, and removed the comments. They didn't add much information, anyway. |
come-nc
left a comment
There was a problem hiding this comment.
See my question on output, but otherwise looks good, codesniffer and DCO are both happy. Failure in drone is unrelated.
Signed-off-by: Joas Schilling <coding@schilljs.com>
|
Not sure if resolved conversations get notified, so here's a copy/paste of it: Yes, you don't want output e.g. in |
They do,
That makes sense. Will make it so. |
Signed-off-by: Joas Schilling <coding@schilljs.com>
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
Hello, can we also get this backported to v25? |
|
usually we only backport bugfixes, but it's arguable here. I will ask some people |
|
/backport to stable25 |
|
No documentation on this? |
|
Should be added to https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html yes. |
|
FYI, the doc update PR is at nextcloud/documentation#9583 |
|
hello @leegarrett |
|
It's linked above nextcloud/documentation#9583 |
Signed-off-by: Lee Garrett lgarrett@rocketjump.eu
Summary
This is an improved version of my earlier PR #35830. This is now a parameter to
status, so it allows for adding more return codes later, which can then for example be consumed in systemd units, or monitoring checks.It adds a parameter that can be used in scripts.
./occ status -ereturns 0 when operating normally, and 1 if there is maintenance mode, 2 if./occ upgradeis required.TODO
Checklist