docs: document changes to the update_manager

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-03-29 12:36:31 -04:00
parent 61c62154ae
commit 210f505157
2 changed files with 52 additions and 0 deletions

View File

@ -405,4 +405,10 @@ install_script:
# The file location, relative to the repository, for the installation script. # The file location, relative to the repository, for the installation script.
# The update manager parses this file for "system" packages that need updating. # The update manager parses this file for "system" packages that need updating.
# The default is no install script, which disables system package updates # The default is no install script, which disables system package updates
enable_node_updates:
# When set to True, Moonraker will asssume that this repo relies upon node
# and will attempt to execute "npm ci --only=prod" when it detects a change
# to package-lock.json. Note that if your project does not have a
# package-lock.json in its root directory then the plugin will fail to load.
# Default is False.
``` ```

View File

@ -1755,6 +1755,7 @@ and `fluidd` are present as clients configured in `moonraker.conf`
"tag": null "tag": null
} }
], ],
"git_messages": [],
"is_valid": true, "is_valid": true,
"debug_enabled": true "debug_enabled": true
} }
@ -1796,6 +1797,12 @@ as git repos have the following fields:
- `commits_behind`: A list of commits behind. Up to 30 "untagged" commits - `commits_behind`: A list of commits behind. Up to 30 "untagged" commits
will be reported. Moonraker checks the last 100 commits for tags, any will be reported. Moonraker checks the last 100 commits for tags, any
commits beyond the last 30 with a tag will also be reported. commits beyond the last 30 with a tag will also be reported.
- `git_messages`: If a repo is in the "invalid" state this field will hold
a list of string messages containing the output of the last failed git
command. Note that it is possible for a git command to fail without
providing output (for example, it may become non-responsive and time out),
so it is possible for this field to be an empty list when the repo is
invalid.
Web clients have the following fields: Web clients have the following fields:
@ -1900,6 +1907,45 @@ Returns:
`ok` when complete `ok` when complete
#### Recover a corrupt repo
On ocassion a git command may fail resulting in a repo in a
dirty or invalid state. When this happens it is possible
to recover. The `name` argument must specify the name of
the repo to recover, it must be of a git repo type. There are two
methods of recovery, the `hard` argument determines which method
is used:
- `hard == true`: Moonraker will remove the old directory
entirely. It will then attempt to recover with `rsync`
by restoring a backup of a recent valid repo.
- `hard == false`: Will run `git clean -f -d` followed
by `git reset --hard {remote}/{branch}`. This is useful
for recovering dirty repos that are valid. It is possible
that this will work on an invalid repo, however it will
not work on a corrupt repo.
The `hard` argument defaults to `false`.
HTTP request:
```http
POST /machine/update/recover?name=moonraker&hard=false
```
JSON-RPC request:
```json
{
"jsonrpc": "2.0",
"method": "machine.update.recover",
"params": {
"name": "moonraker",
"hard": false
},
"id": 4564
}
```
Returns:
`ok` when complete
### Power APIs ### Power APIs
The APIs below are available when the `[power]` component has been configured. The APIs below are available when the `[power]` component has been configured.