vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Generate the CLI reference and help from one command table
f380ab70420ddf24f68931fa26e1288aff4acca6 · Keenan Nemetz · 23d ago · parent c284cb2c
Generate the CLI reference and help from one command table
The CLI documented itself four ways: a usage string per command group, inline
"usage: vole ..." strings in error paths, a per-group accepted-flag list, and
docs/cli.md, which was hand-written and had already drifted. `vole help` never
listed `run list`, `run show` or `run logs`, though all three exist and
`vole run -h` documented them; the reference listed them.
Each group now declares its subcommands, its flags (with argument and a one-line
description), its notes and its links in one table, in the file that parses it.
Three things render from that table:
- `vole help` and `vole <group> -h`, which gain an Options section and now list
every command and every flag;
- `vole help --markdown`, which writes docs/cli.md;
- `checkAllowed`, which refuses a flag the subcommand does not document — the
per-group flag lists are gone, so the parser and the docs are one list.
verify regenerates docs/cli.md and fails on any difference, so the page cannot go
stale. cmd/vole/help_test.go checks that every flag has a description, that every
parsed flag is documented by some subcommand, that each subcommand accepts exactly
the flags it lists, and that the committed reference matches the binary.
Closes: 01M7359KQ6Z8W91N8WNWVV120B
docs/cli.md +455−182
| @@ -7,96 +7,78 @@ secure or keep in sync. | |||
| 7 | 7 | Run `vole help` for the built-in summary. If you make a usage mistake, Vole exits | |
| 8 | 8 | with code `129`, just like Git. | |
| 9 | 9 | ||
| 10 | ## Common options | ||
| 11 | |||
| 12 | | Option | Used by | Meaning | | ||
| 13 | |---|---|---| | ||
| 14 | | `--config <path>` | Local server management | Use a different `vole.toml` (default: `./vole.toml`, then `~/.vole/vole.toml`; `VOLE_CONFIG` overrides both) | | ||
| 15 | | `--remote <name\|url>` | `admin`, issue, change, release, and pages commands | Git remote or instance SSH URL to talk to | | ||
| 16 | | `--json` | `admin --remote` | Print the server's JSON response | | ||
| 17 | | `--no-push` | `issue`, `change` | Commit locally without pushing | | ||
| 18 | | `--dir <path>` | `init`, `workflow`, `runner` | Working or checkout directory | | ||
| 19 | | `--branch <name>` | `pages` | Site branch (default `pages`) | | ||
| 20 | | `--format <fmt>` | `issue list`, `change list` | Output fields such as `%(id)`, `%(number)` and `%(title)`, or `json` | | ||
| 21 | | `-h`, `--help` | All | Print usage | | ||
| 10 | This page is generated: `vole help --markdown > docs/cli.md`. Do not edit it by | ||
| 11 | hand; the verify workflow fails when it differs from what the binary prints. | ||
| 22 | 12 | ||
| 23 | 13 | Options follow Git's conventions: `--long value`, `--long=value`, `-o value`, | |
| 24 | 14 | `-ovalue`, bundled short options such as `-am`, repeated options, and `--` to | |
| 25 | end option parsing. Options may appear before or after arguments. `vole help | ||
| 26 | <command>` and `vole <command> -h` print that command's usage. | ||
| 15 | end option parsing. Options may appear before or after arguments. `-h`, | ||
| 16 | `--help` prints any command's usage, and `vole help <command>` is the same | ||
| 17 | thing. | ||
| 27 | 18 | ||
| 28 | ## Secrets | ||
| 29 | |||
| 30 | A repository's secrets are the values its maintainers share, stored on the | ||
| 31 | instance, encrypted, and never in the repository: | ||
| 19 | ## Instance | ||
| 32 | 20 | ||
| 33 | 21 | ```sh | |
| 34 | vole secret list <repo> | ||
| 35 | vole secret set <repo> <NAME> # the value is read from stdin | ||
| 36 | vole secret set <repo> <NAME> --from-file key.pem | ||
| 37 | vole secret get <repo> <NAME> # the value, and nothing else | ||
| 38 | vole secret rm <repo> <NAME> | ||
| 22 | vole serve [--config <path>] [--log <level>] | ||
| 39 | 23 | ``` | |
| 40 | 24 | ||
| 41 | `set` reads the value from standard input or a file and never from the command | ||
| 42 | line: an argument is visible to every process on the host and lands in shell | ||
| 43 | history. On a terminal it prompts without echoing; from a pipe it removes one | ||
| 44 | trailing newline, so `echo "$TOKEN" | vole secret set demo DEPLOY_KEY` stores the | ||
| 45 | token and not the line ending. `get` writes the value with no newline added, so it | ||
| 46 | can be redirected to a file. | ||
| 25 | The listeners come from vole.toml: SSH for authenticated Git writes, HTTP | ||
| 26 | for the web and anonymous clone. It runs in the foreground and stops on | ||
| 27 | interrupt. | ||
| 47 | 28 | ||
| 48 | `set` needs the maintainer role in that repository, and every read and change is | ||
| 49 | recorded in `data/audit.log`. `list` shows names, versions, who last changed one, | ||
| 50 | and when a value was last read — never a value. The same values appear on the | ||
| 51 | repository's **Settings** tab, which is write-only: a saved value is not shown | ||
| 52 | again. | ||
| 29 | | Option | Used by | Meaning | | ||
| 30 | |---|---|---| | ||
| 31 | | `-c, --config <path>` | — | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 32 | | `--log <level>` | — | log level: debug, or the default info | | ||
| 53 | 33 | ||
| 54 | Names are upper-case letters, digits and `_`, so a name can be read as an | ||
| 55 | environment variable. A value is limited to 128 KiB, the most one environment | ||
| 56 | variable can carry. | ||
| 34 | See [Configuration](configuration.md), [Deploying](deploy/README.md). | ||
| 57 | 35 | ||
| 58 | ## Instance | ||
| 36 | ## Server management | ||
| 37 | |||
| 38 | `vole admin` is the single namespace for account, repository (`repo`), and | ||
| 39 | access (`acl`) management. Without `--remote`, it changes the instance named | ||
| 40 | by the local `vole.toml`. With `--remote`, it sends the same command over SSH | ||
| 41 | and must be run by an instance admin. `--remote` accepts a Git remote name or | ||
| 42 | an instance URL such as `ssh://git@forge.example.com:2222`; `--json` prints the | ||
| 43 | server's JSON response instead of text. | ||
| 59 | 44 | ||
| 60 | 45 | ```sh | |
| 61 | vole admin init [--dir <path> | --config <path>] | ||
| 62 | vole serve [--config <path>] [--log debug] | ||
| 63 | vole version | ||
| 46 | vole admin [--remote <name|ssh-url>] [--config <path>] [--json] <command>... | ||
| 64 | 47 | ``` | |
| 65 | 48 | ||
| 66 | ## Server management | ||
| 49 | | Option | Used by | Meaning | | ||
| 50 | |---|---|---| | ||
| 51 | | `--remote <name\|ssh-url>` | — | run the command on the instance this remote names, as an instance admin | | ||
| 52 | | `--config <path>` | — | the vole.toml to read; local only, and refused with --remote | | ||
| 53 | | `--json` | — | print the server's JSON response instead of text (needs --remote) | | ||
| 67 | 54 | ||
| 68 | `vole admin` is the single namespace for account, repository (`repo`), and access | ||
| 69 | (`acl`) management. | ||
| 70 | Without `--remote`, it changes the instance named by the local `vole.toml`. With | ||
| 71 | `--remote`, it sends the same command over SSH and must be run by an instance | ||
| 72 | admin. | ||
| 55 | See [Accounts and access § Remote administration](accounts-and-access.md#remote-administration). | ||
| 56 | |||
| 57 | ### admin init | ||
| 73 | 58 | ||
| 74 | 59 | ```sh | |
| 75 | vole admin account create alice --key ~/.ssh/id_ed25519.pub | ||
| 76 | vole admin --config /srv/vole/vole.toml account list | ||
| 77 | vole admin --remote origin account create bob --key bob.pub | ||
| 78 | vole admin --remote ssh://git@forge.example.com:2222 account list | ||
| 60 | vole admin init [--dir <path> | --config <path>] | ||
| 79 | 61 | ``` | |
| 80 | 62 | ||
| 81 | `--config` names a `vole.toml` other than the one discovery finds, and may sit on | ||
| 82 | either side of the command (`vole admin --config P account list` and `vole admin | ||
| 83 | account list --config P` are the same). It is local only: with `--remote` the | ||
| 84 | server's own config is the one that applies. | ||
| 63 | `--dir` creates an instance in <path>: the config at <path>/vole.toml, the | ||
| 64 | data beside it. `--config` prepares the instance an existing config names, | ||
| 65 | which is how a package ships /etc/vole/vole.toml and lets init create the | ||
| 66 | database and repository tree it points at. Give one or the other, not both. | ||
| 67 | It is local-only: it is not available over --remote. | ||
| 85 | 68 | ||
| 86 | See [Accounts and access](accounts-and-access.md#remote-administration). | ||
| 87 | |||
| 88 | `vole admin account` is the documented spelling. The old `vole admin user` form | ||
| 89 | and the pre-admin aliases (`vole account`, `vole user`, `vole repo`, `vole acl`, | ||
| 90 | `vole index`, and `vole gc`) remain for compatibility; documentation and help use | ||
| 91 | `vole admin account`. | ||
| 69 | | Option | Used by | Meaning | | ||
| 70 | |---|---|---| | ||
| 71 | | `-d, --dir <path>` | — | create the instance here: <path>/vole.toml and the data beside it | | ||
| 72 | | `--config <path>` | — | prepare the instance an existing config names | | ||
| 92 | 73 | ||
| 93 | ### Accounts | ||
| 74 | See [Quickstart](getting-started.md), [Packages](packaging.md). | ||
| 94 | 75 | ||
| 95 | The `account` commands manage accounts. | ||
| 76 | ### admin account | ||
| 96 | 77 | ||
| 97 | 78 | ```sh | |
| 98 | 79 | vole admin account create [--key <file|->] [--role <role>] [--bot] <name> | |
| 99 | 80 | vole admin account invite <name> | |
| 81 | vole admin account role <name> <none|read|contribute|maintain|admin> | ||
| 100 | 82 | vole admin account credentials <name> | |
| 101 | 83 | vole admin account rm-credential <name> <credential-id> | |
| 102 | 84 | vole admin account sessions <name> | |
| @@ -104,34 +86,42 @@ vole admin account revoke-sessions [--all | <name>] | |||
| 104 | 86 | vole admin account add-key --key <file|-> <name> | |
| 105 | 87 | vole admin account rm-key <name> <fingerprint> | |
| 106 | 88 | vole admin account retire <name> | |
| 107 | vole admin account role <name> <none|read|contribute|maintain|admin> | ||
| 108 | 89 | vole admin account grant-admin <name> | |
| 109 | vole admin account revoke-admin <name> | ||
| 110 | 90 | vole admin account show <name> | |
| 111 | 91 | vole admin account list | |
| 112 | 92 | vole admin account backup <path> | |
| 113 | vole whoami [--remote <name>] [--role] | ||
| 93 | vole admin account rename <name> | ||
| 114 | 94 | ``` | |
| 115 | 95 | ||
| 116 | 96 | Omitting `--key` creates a browser-only account and prints a one-time enrollment | |
| 117 | link. `--bot` creates an automation account instead: it has no browser sign-in and | ||
| 118 | cannot be an instance admin, so it must be created with a key. `--role` sets the | ||
| 119 | account's instance-wide role; it applies to public repositories, while `admin` | ||
| 120 | applies to every repository. `account role` changes it later. `account invite` | ||
| 121 | issues a fresh link for an existing account. `account backup` writes a file on the | ||
| 122 | host, so it is local-only. | ||
| 97 | link. `--bot` creates an automation account instead: it has no browser sign-in | ||
| 98 | and cannot be an instance admin, so it must be created with a key. `--role` | ||
| 99 | sets the account's instance-wide role; it applies to public repositories, while | ||
| 100 | `admin` applies to every repository. `account role` changes it later. | ||
| 101 | |||
| 102 | `invite` — Prints a fresh one-time enrollment link for an existing account, which is how a passkey gets registered. Keep the link private: it is the one thing that grants browser access. | ||
| 103 | |||
| 104 | `credentials` — Lists the account's passkeys and when each was last used. A credential id is what `rm-credential` takes. | ||
| 105 | |||
| 106 | `rm-credential` — Revokes one passkey. Any prefix of the credential id is enough. | ||
| 107 | |||
| 108 | `retire`, `rm`, `delete` — Retiring is the closest thing to deleting an account: its keys stop working within five seconds, and the name is never reissued. `rm` and `delete` are accepted for the same command. | ||
| 109 | |||
| 110 | `backup` — Writes the account database to <path> on the host, so it is local-only. The copy holds accounts, keys and passkeys; session and invite tokens are hashed, and VACUUM INTO keeps it consistent while the instance runs. | ||
| 111 | |||
| 112 | `rename`, `display` — Refused: an account name is permanent. It is the folder a contribute account's branches live under, so it is fixed at creation and never reissued. | ||
| 123 | 113 | ||
| 124 | The account name is the only identifier an account has. It cannot be changed: it | ||
| 125 | is the folder a `contribute` account's branches live under, so it is fixed at | ||
| 126 | creation and never reissued. | ||
| 114 | | Option | Used by | Meaning | | ||
| 115 | |---|---|---| | ||
| 116 | | `-c, --config <path>` | all | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 117 | | `-k, --key <file\|->` | create, add-key | the public key to use; - reads standard input | | ||
| 118 | | `--role <role>` | create | instance-wide role: none, read, contribute, maintain, or admin | | ||
| 119 | | `--bot` | create | an automation account: no browser sign-in, and a key is required | | ||
| 120 | | `--all` | revoke-sessions | revoke every account's sessions, not just one account's | | ||
| 127 | 121 | ||
| 128 | `vole whoami` prints the account name. With `--role` it prints the effective role | ||
| 129 | on the repository named by the remote: the repository's default and per-account | ||
| 130 | rules, with the account's instance-wide role applied where the repository is | ||
| 131 | public. A private repository the account cannot read is reported as not found, | ||
| 132 | the same as a fetch. | ||
| 122 | See [Accounts and access](accounts-and-access.md). | ||
| 133 | 123 | ||
| 134 | ### Repositories | ||
| 124 | ### admin repo | ||
| 135 | 125 | ||
| 136 | 126 | ```sh | |
| 137 | 127 | vole admin repo create --owner <account> <name> [--description <text>] | |
| @@ -143,30 +133,32 @@ vole admin repo delete <name> | |||
| 143 | 133 | ||
| 144 | 134 | New repositories are private. The owner becomes the first admin. | |
| 145 | 135 | ||
| 146 | ### Access | ||
| 136 | `delete` — Deleting a repository removes its refs, its metadata branch, its LFS objects and its CI history. It is audited, and there is no undo. | ||
| 147 | 137 | ||
| 148 | Instance-wide roles are account standing; repository rules are set with `acl`: | ||
| 138 | | Option | Used by | Meaning | | ||
| 139 | |---|---|---| | ||
| 140 | | `-c, --config <path>` | all | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 141 | | `-o, --owner <account>` | create | the account that owns the new repository and becomes its first admin | | ||
| 142 | | `-d, --description <text>` | create | one line shown beside the repository | | ||
| 149 | 143 | ||
| 150 | ```sh | ||
| 151 | vole admin account role <name> <none|read|contribute|maintain|admin> | ||
| 144 | See [Accounts and access](accounts-and-access.md). | ||
| 145 | |||
| 146 | ### admin acl | ||
| 152 | 147 | ||
| 148 | ```sh | ||
| 153 | 149 | vole admin acl show <repo> | |
| 154 | 150 | vole admin acl set-role <repo> <account> <none|read|contribute|maintain|admin> | |
| 155 | 151 | vole admin acl set-default-role <repo> <none|read|contribute|maintain|admin> | |
| 156 | 152 | vole admin acl set-approvals <repo> <n> | |
| 157 | |||
| 158 | 153 | vole admin acl checks enable <repo> | |
| 159 | 154 | vole admin acl checks disable <repo> | |
| 160 | |||
| 161 | 155 | vole admin acl require-issues enable <repo> | |
| 162 | 156 | vole admin acl require-issues disable <repo> | |
| 163 | |||
| 164 | 157 | vole admin acl protect list <repo> | |
| 165 | 158 | vole admin acl protect add <repo> <ref-pattern>... | |
| 166 | 159 | vole admin acl protect remove <repo> <ref-pattern>... | |
| 167 | 160 | vole admin acl protect set <repo> <ref-pattern>... | |
| 168 | 161 | vole admin acl protect clear <repo> | |
| 169 | |||
| 170 | 162 | vole admin acl runners list <repo> | |
| 171 | 163 | vole admin acl runners add <repo> <account>... | |
| 172 | 164 | vole admin acl runners remove <repo> <account>... | |
| @@ -176,31 +168,83 @@ vole admin acl runners clear <repo> | |||
| 176 | 168 | ||
| 177 | 169 | `set-role` and `set-default-role` accept `none` to remove access. `protect set` | |
| 178 | 170 | and `runners set` replace the whole list; the `add` and `remove` forms change one | |
| 179 | entry at a time. `require-issues enable` makes a linked issue mandatory when a | ||
| 180 | new change request is opened. | ||
| 171 | entry at a time. | ||
| 181 | 172 | ||
| 182 | 173 | A protected ref pattern is either an exact ref (`refs/heads/main`) or a ref | |
| 183 | 174 | prefix ending in one `*` (`refs/heads/release/*`), the two shapes the hook | |
| 184 | 175 | understands. `protect add` and `protect set` refuse anything else, because a | |
| 185 | pattern that can never match would leave the branch open while `acl show` listed | ||
| 186 | it as protected. A misspelled category is named in the refusal: | ||
| 176 | pattern that can never match would leave the branch open while `acl show` | ||
| 177 | listed it as protected. | ||
| 187 | 178 | ||
| 188 | ```console | ||
| 189 | $ vole admin acl protect add demo refs/head/main | ||
| 190 | vole: protected pattern "refs/head/main" cannot match any ref: did you mean "refs/heads/main"? | ||
| 191 | ``` | ||
| 179 | `set-approvals` — How many approvals landing a change request needs. | ||
| 192 | 180 | ||
| 193 | See [Accounts and access](accounts-and-access.md) and | ||
| 194 | [Runners](runner.md#who-can-run-jobs-and-report-results). | ||
| 181 | `require-issues enable` — Makes a linked issue mandatory when a new change request is opened. | ||
| 182 | |||
| 183 | | Option | Used by | Meaning | | ||
| 184 | |---|---|---| | ||
| 185 | | `-c, --config <path>` | all | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 195 | 186 | ||
| 196 | ### Maintenance | ||
| 187 | See [Accounts and access](accounts-and-access.md), [Runners](runner.md#who-can-run-jobs-and-report-results). | ||
| 188 | |||
| 189 | ### admin gc | ||
| 197 | 190 | ||
| 198 | 191 | ```sh | |
| 199 | 192 | vole admin gc [--dry-run] [--grace <duration>] | |
| 193 | ``` | ||
| 194 | |||
| 195 | Marks LFS objects reachable from any ref in any repository, and from archived | ||
| 196 | CI logs and published artifacts in the run queue, then removes the rest. | ||
| 197 | Objects younger than --grace (default 1h) are kept: an upload that has not | ||
| 198 | been pushed yet is not garbage. | ||
| 199 | |||
| 200 | An object is served through a per-repository namespace, so a sweep also | ||
| 201 | reconciles those links: it links what a repository reaches and unlinks what | ||
| 202 | it no longer does. That is the repair path for a store whose links are | ||
| 203 | missing — vole admin gc restores them, and the server does the same once on | ||
| 204 | first boot after an upgrade. | ||
| 205 | |||
| 206 | Local-only: it is not available over --remote. | ||
| 207 | |||
| 208 | | Option | Used by | Meaning | | ||
| 209 | |---|---|---| | ||
| 210 | | `-c, --config <path>` | — | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 211 | | `-n, --dry-run` | — | report what would be removed, and remove nothing | | ||
| 212 | | `-g, --grace <duration>` | — | keep objects younger than this (default 1h) | | ||
| 213 | |||
| 214 | See [Operations](operations.md). | ||
| 215 | |||
| 216 | ### admin index | ||
| 217 | |||
| 218 | ```sh | ||
| 200 | 219 | vole admin index rebuild | |
| 201 | 220 | ``` | |
| 202 | 221 | ||
| 203 | These are local-only. See [Operations](operations.md). | ||
| 222 | Rebuilds the index every search and listing reads. It is derived, so this | ||
| 223 | repairs it rather than losing anything. Local-only: it is not available over | ||
| 224 | --remote. | ||
| 225 | |||
| 226 | | Option | Used by | Meaning | | ||
| 227 | |---|---|---| | ||
| 228 | | `-c, --config <path>` | — | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 229 | |||
| 230 | ### whoami | ||
| 231 | |||
| 232 | ```sh | ||
| 233 | vole whoami [--remote <name>] [--role] | ||
| 234 | ``` | ||
| 235 | |||
| 236 | Asks the instance which account the SSH key you push with belongs to. That | ||
| 237 | mapping exists only on the instance; git config holds a name somebody typed. | ||
| 238 | |||
| 239 | With --role, prints the effective role that account holds on the repository | ||
| 240 | named by the remote, instead of the account name. | ||
| 241 | |||
| 242 | | Option | Used by | Meaning | | ||
| 243 | |---|---|---| | ||
| 244 | | `--remote <name>` | — | the remote naming the instance (name or ssh:// URL); default origin | | ||
| 245 | | `--role` | — | print the effective role on this repository instead of the name | | ||
| 246 | |||
| 247 | See [Accounts and access](accounts-and-access.md#remote-administration). | ||
| 204 | 248 | ||
| 205 | 249 | ## Issues | |
| 206 | 250 | ||
| @@ -214,17 +258,41 @@ vole issue assign <id> <account>... | |||
| 214 | 258 | vole issue unassign <id> <account>... | |
| 215 | 259 | vole issue close <id> | |
| 216 | 260 | vole issue reopen <id> | |
| 217 | vole issue list [--state open|closed|all] [-l <label>]... [--assignee <account>]... [--format <fmt>] | ||
| 261 | vole issue list [--state <state>] [-l <label>]... [--assignee <account>]... [--format <fmt>] | ||
| 218 | 262 | vole issue show <id> | |
| 219 | 263 | ``` | |
| 220 | 264 | ||
| 221 | Ids and comment ids accept a unique prefix. See [Issues](issues.md). | ||
| 265 | Multiple `-l`, `-a` and `--assignee` options are allowed. A comment id takes a | ||
| 266 | prefix. An issue id takes a prefix or the #42 number: numbers are one sequence | ||
| 267 | shared with change requests, oldest first. | ||
| 268 | |||
| 269 | Deleting a comment leaves the text in git; only its author (or an admin, audited) | ||
| 270 | can edit or delete it. | ||
| 271 | |||
| 272 | `list` — `--format` understands `%(number)`, `%(id)`, `%(shortid)`, `%(state)`, `%(author)`, `%(title)`, `%(labels)`, `%(assignees)` and `%(created)`. | ||
| 273 | |||
| 274 | | Option | Used by | Meaning | | ||
| 275 | |---|---|---| | ||
| 276 | | `-t, --title <title>` | new, edit | the issue title | | ||
| 277 | | `-m, --message <text>` | new, comment, edit-comment, edit | the body text; an alternative to -F | | ||
| 278 | | `-F, --file <file\|->` | new, comment, edit-comment, edit | read the body from a file; - reads standard input | | ||
| 279 | | `--reply-to <comment-id>` | comment | the comment this one replies to | | ||
| 280 | | `-l, --label <label>` | new, edit, list | a label to add; repeatable | | ||
| 281 | | `-a, --assign <account>` | new, edit | an account to assign; repeatable | | ||
| 282 | | `--unassign <account>` | edit | an account to remove from the assignees; repeatable | | ||
| 283 | | `--assignee <account>` | list | only issues assigned to this account; repeatable | | ||
| 284 | | `--state <state>` | list | open, closed, or all (default open) | | ||
| 285 | | `--remote <name>` | all | the remote naming the instance (default origin) | | ||
| 286 | | `--format <fmt>` | list | a template such as '%(number) %(title)' | | ||
| 287 | | `--no-push` | new, comment, edit-comment, rm-comment, edit, assign, unassign, close, reopen | commit locally without pushing | | ||
| 288 | |||
| 289 | See [Issues](issues.md). | ||
| 222 | 290 | ||
| 223 | 291 | ## Change requests | |
| 224 | 292 | ||
| 225 | 293 | ```sh | |
| 226 | 294 | vole change new --title <title> --base <branch> [--head <rev>] [--closes <issue>]... [-m <text> | -F <file>] | |
| 227 | vole change list [--state open|closed|all] [--format <fmt>] | ||
| 295 | vole change list [--state <state>] [--format <fmt>] | ||
| 228 | 296 | vole change show <id> | |
| 229 | 297 | vole change comment <id> [-m <text> | -F <file>] [--path <file> --line <n> [--side new|old]] [--reply-to <comment-id>] | |
| 230 | 298 | vole change edit-comment <id> <comment-id> [-m <text> | -F <file>] | |
| @@ -236,21 +304,47 @@ vole change close <id> | |||
| 236 | 304 | vole change reopen <id> | |
| 237 | 305 | ``` | |
| 238 | 306 | ||
| 239 | `change` also accepts `request`, `requests` and `cr` as compatibility aliases. An | ||
| 240 | approval is only accepted from the account it names. `--closes` takes a full | ||
| 241 | issue id (repeatable, comma lists accepted) and names the issues landing the | ||
| 242 | request closes; it replaces the list on `update`, and `--no-closes` clears it. | ||
| 243 | A request opened with `--head <branch>` follows that branch: a later push moves its | ||
| 244 | head and invalidates the old approvals and checks. `--head <commit>` (or a tag) | ||
| 245 | pins the request to that commit instead. `--base <branch>` on `update` retargets an | ||
| 246 | open request, which is how a stacked request moves onto `main` after the branch | ||
| 247 | below it lands; approvals named the old base and stop counting. See | ||
| 248 | [Change requests](change-requests.md). | ||
| 249 | |||
| 250 | `change merge` lands the request. When the combined result is still building it | ||
| 251 | prints that the request will merge when the result passes, which is the same | ||
| 252 | "merge when ready" a click on the page arms. `change show` prints the combined | ||
| 253 | result and whether the landing is ready. | ||
| 307 | `change` also accepts `request`, `requests` and `cr` as compatibility aliases. | ||
| 308 | An id takes a prefix or the #42 number: numbers are one sequence shared with | ||
| 309 | issues, oldest first. | ||
| 310 | |||
| 311 | A request opened with `--head <branch>` follows that branch: a later push moves | ||
| 312 | its head and invalidates the old approvals and checks. `--head <commit>` (or a | ||
| 313 | tag) pins the request to that commit instead. | ||
| 314 | |||
| 315 | `--no-push` commits locally without pushing. A comment is yours to edit or | ||
| 316 | delete; an admin may repair somebody else's, audited. | ||
| 317 | |||
| 318 | `list` — `--format json` prints one JSON object per request; any other value is used as a template. | ||
| 319 | |||
| 320 | `show` — Prints the combined result and whether the landing is ready. | ||
| 321 | |||
| 322 | `update` — `--base` retargets an open request, which is how a stacked request moves onto `main` after the branch below it lands; approvals named the old base and stop counting. `--closes` replaces the list, and `--no-closes` clears it. | ||
| 323 | |||
| 324 | `approve` — An approval is only accepted from the account it names, and never by the author's own account. | ||
| 325 | |||
| 326 | `merge` — Lands the request. When the combined result is still building it says the request will merge when the result passes, which is the same merge-when-ready a click on the page arms. | ||
| 327 | |||
| 328 | | Option | Used by | Meaning | | ||
| 329 | |---|---|---| | ||
| 330 | | `-t, --title <title>` | new | the request title | | ||
| 331 | | `-b, --base <branch>` | new, update | the branch the change lands on | | ||
| 332 | | `-H, --head <rev>` | new, update | the branch that follows the request, or a commit or tag to pin it to | | ||
| 333 | | `--closes <issue>` | new, update | an issue the request closes; repeatable, and comma lists are accepted | | ||
| 334 | | `-m, --message <text>` | new, comment, edit-comment | the text; an alternative to -F | | ||
| 335 | | `-F, --file <file\|->` | new, comment, edit-comment | read the text from a file; - reads standard input | | ||
| 336 | | `--as <account>` | approve | the account an approval is made for | | ||
| 337 | | `--path <file>` | comment | the file a review comment is on | | ||
| 338 | | `--line <n>` | comment | the line the comment is on; needs --path | | ||
| 339 | | `--side <side>` | comment | new or old side of the diff (default new) | | ||
| 340 | | `--reply-to <comment-id>` | comment | the comment this one replies to | | ||
| 341 | | `--state <state>` | list | open, closed, or all (default open) | | ||
| 342 | | `--remote <name>` | all | the remote naming the instance (default origin) | | ||
| 343 | | `--format <fmt>` | list | a template, or json | | ||
| 344 | | `--no-push` | new, comment, edit-comment, rm-comment, update, approve, close, reopen | commit locally without pushing | | ||
| 345 | | `--no-closes` | update | clear the issues the request closes | | ||
| 346 | |||
| 347 | See [Change requests](change-requests.md). | ||
| 254 | 348 | ||
| 255 | 349 | ## Releases | |
| 256 | 350 | ||
| @@ -259,8 +353,54 @@ vole release create <tag> (-m <text> | -F <file|->) | |||
| 259 | 353 | vole release attach <tag> <file>... [--remote <name>] | |
| 260 | 354 | ``` | |
| 261 | 355 | ||
| 262 | `create` writes the annotated tag in the current repository; push it with | ||
| 263 | `git push --follow-tags`. See [Releases](releases.md). | ||
| 356 | A release is an annotated tag: its message is the release notes and its tree is | ||
| 357 | the source tarball, so both travel with any clone. | ||
| 358 | |||
| 359 | `create` — Writes the annotated tag in the current repository; push it with `git push --follow-tags`. A release is immutable once pushed, so a new version is a new tag. | ||
| 360 | |||
| 361 | `attach` — Uploads each file over SSH and records it as `releases/<tag>/<name>` on the metadata branch. Nothing is published until the pointer is pushed, so attach after `git push --follow-tags`, not before. | ||
| 362 | |||
| 363 | | Option | Used by | Meaning | | ||
| 364 | |---|---|---| | ||
| 365 | | `-m, --message <text>` | create | the release notes | | ||
| 366 | | `-F, --file <file\|->` | create | read the release notes from a file; - reads standard input | | ||
| 367 | | `--remote <name>` | attach | the remote naming the instance (default origin) | | ||
| 368 | |||
| 369 | See [Releases](releases.md). | ||
| 370 | |||
| 371 | ## Secrets | ||
| 372 | |||
| 373 | ```sh | ||
| 374 | vole secret list <repository> [--remote <name|url>] | ||
| 375 | vole secret get <repository> <name> [--remote <name|url>] | ||
| 376 | vole secret set <repository> <name> [--from-file <path>] [--remote <name|url>] | ||
| 377 | vole secret rm <repository> <name> [--remote <name|url>] | ||
| 378 | ``` | ||
| 379 | |||
| 380 | A secret is a value this repository keeps out of its code: a deploy key, a | ||
| 381 | registry token, a staging password. It is stored encrypted on the instance, and | ||
| 382 | its name is upper-case letters, digits and `_`, so it can be read as an | ||
| 383 | environment variable. | ||
| 384 | |||
| 385 | These commands run against the instance the remote points at (default: origin). | ||
| 386 | Reading and writing both need the maintainer role in that repository, and every | ||
| 387 | read and change is recorded in `data/audit.log`. | ||
| 388 | |||
| 389 | A value is limited to 128 KiB, the most one environment variable can carry. The | ||
| 390 | same values appear on the repository's Settings tab, which is write-only. | ||
| 391 | |||
| 392 | `list` — Shows names, versions and read times. It never shows a value. | ||
| 393 | |||
| 394 | `get` — Writes the value and nothing else, so it can be redirected to a file. | ||
| 395 | |||
| 396 | `set` — Takes the value from standard input, or from --from-file; --from-file - reads standard input. One trailing newline is removed from a piped value, so `echo token | vole secret set …` stores the token. The value never comes from an argument, which would be visible to every process on the host and would land in shell history. | ||
| 397 | |||
| 398 | | Option | Used by | Meaning | | ||
| 399 | |---|---|---| | ||
| 400 | | `--remote <name\|url>` | all | the remote naming the instance (default origin) | | ||
| 401 | | `-F, --from-file <path\|->` | set | read the value from a file; - reads standard input | | ||
| 402 | |||
| 403 | See [Workflows § Secrets](workflows.md#secrets). | ||
| 264 | 404 | ||
| 265 | 405 | ## Pages | |
| 266 | 406 | ||
| @@ -270,80 +410,213 @@ vole pages status [--branch <name>] [--remote <name>] | |||
| 270 | 410 | vole pages unpublish [--branch <name>] [--remote <name>] | |
| 271 | 411 | ``` | |
| 272 | 412 | ||
| 413 | The site is served at <repo>.<pages_domain>, which the instance configures; | ||
| 414 | if the operator changed `pages_ref`, pass the same branch name here. | ||
| 415 | |||
| 416 | `deploy` — Replaces the branch's tree with <dir> (default the current directory), so a page deleted from the build stops being served. | ||
| 417 | |||
| 418 | `status`, `show` — Reports what is published on the branch. | ||
| 419 | |||
| 420 | `unpublish`, `rm`, `remove` — Deletes the branch, so the site answers 404. `rm` and `remove` are accepted for the same command. | ||
| 421 | |||
| 422 | | Option | Used by | Meaning | | ||
| 423 | |---|---|---| | ||
| 424 | | `--branch <name>` | all | the branch that holds the site (default pages, or the instance's pages_ref) | | ||
| 425 | | `--remote <name>` | all | the remote naming the instance (default origin) | | ||
| 426 | | `-m, --message <text>` | deploy | commit message for the publish | | ||
| 427 | | `-F, --file <file>` | deploy | read the commit message from a file | | ||
| 428 | | `--dry-run` | deploy | report what deploy would publish, and publish nothing | | ||
| 429 | |||
| 273 | 430 | See [Sites](sites.md). | |
| 274 | 431 | ||
| 275 | 432 | ## CI | |
| 276 | 433 | ||
| 434 | ### runner | ||
| 435 | |||
| 436 | ```sh | ||
| 437 | vole runner --remote ssh://git@host[:port] [--once] [--jobs <n>] [--dir <path>] [--repos <name>]... [--label <name>]... [--container-runtime <name>] [--container-network <mode>] [--container-pull <mode>] [--container-user <uid:gid>] [--container-userns <mode>] [--container-memory <size>] [--container-cpus <n>] [--container-pids <n>] [--cache-size <size>] [--git-cache-size <size>] [--no-cache] [--known-hosts <path> | --insecure-host-key] | ||
| 438 | ``` | ||
| 439 | |||
| 440 | Leases CI jobs from a Vole instance and runs them. Authentication is the SSH | ||
| 441 | key you would push with, so there is no token to configure. A runner may only | ||
| 442 | run jobs for repositories whose runner allowlist its account is on (admins are | ||
| 443 | implicit): running a job executes that repository's code, which is a bigger | ||
| 444 | power than writing to it. | ||
| 445 | |||
| 446 | Every finished attempt commits a record to the repository's metadata branch, | ||
| 447 | together with the artifacts the build published, in one push: the runner is the | ||
| 448 | party that did the work, so the runner is the party that states the result. The | ||
| 449 | push authenticates with the same key, and pre-receive checks the allowlist. | ||
| 450 | |||
| 451 | Host key. A runner executes repository code, so the instance it trusts is a | ||
| 452 | security boundary. The SSH host key is verified against your known_hosts, and an | ||
| 453 | unknown or changed host is refused. Populate the file with | ||
| 454 | `ssh-keyscan -p <port> <host> >> ~/.ssh/known_hosts`. | ||
| 455 | |||
| 456 | Container execution. A runner always needs an OCI runtime. Each job names its | ||
| 457 | image in the workflow, and the runner starts one container per job and removes | ||
| 458 | it afterward; the runner's key and trusted checkout stay outside the container. | ||
| 459 | The image must have /bin/sh and a POSIX sleep, because Vole runs shell steps and | ||
| 460 | keeps the container alive between them. A workflow image-file definition is | ||
| 461 | built locally before the job starts and cached by definition digest; the build | ||
| 462 | uses the runtime's own network, not --container-network. The runtime is checked | ||
| 463 | at startup with `<runtime> info`, and the runner refuses to serve when that | ||
| 464 | fails. | ||
| 465 | |||
| 466 | Job cache. Each job gets a writable directory at /cache, kept under --dir/cache | ||
| 467 | and reused by later jobs of the same repository and image. The runner mounts it | ||
| 468 | and sets no variables: a job opts in by pointing its own at /cache, in the | ||
| 469 | image's env: (for example GOCACHE=/cache/go-build) or in the step. Namespaces | ||
| 470 | are per repository, and contributor branches get their own, so one branch | ||
| 471 | cannot seed another's cache. | ||
| 472 | |||
| 473 | Saved checkouts. The first job for a repository clones it once into --dir and | ||
| 474 | keeps that clone, so a later job clones from disk and only commits it does not | ||
| 475 | have cross the network. The clone is never mounted into a job: the workflow's | ||
| 476 | checkout is a copy with its own .git, so a hook or a changed config dies with | ||
| 477 | the job. | ||
| 478 | |||
| 479 | | Option | Used by | Meaning | | ||
| 480 | |---|---|---| | ||
| 481 | | `-r, --remote <url>` | — | the instance to lease jobs from, as ssh://git@host:port | | ||
| 482 | | `--dir <path>` | — | where checkouts and the cache live (default: the user cache directory, under vole-runner) | | ||
| 483 | | `--repos <name>` | — | only take jobs for this repository; repeatable, and it cannot grant access | | ||
| 484 | | `--label <name>` | — | a label this machine carries, such as linux or arm64; repeatable | | ||
| 485 | | `--once` | — | run one job, then exit | | ||
| 486 | | `--jobs <n>` | — | how many jobs to run at once (default 1) | | ||
| 487 | | `--container-runtime <name>` | — | docker (default), podman, or nerdctl | | ||
| 488 | | `--container-network <mode>` | — | none (default) or bridge: the most this machine offers a job | | ||
| 489 | | `--container-pull <mode>` | — | missing (default), always, or never | | ||
| 490 | | `--container-user <uid:gid>` | — | the user the steps run as (default: this user) | | ||
| 491 | | `--container-userns <mode>` | — | user namespace mode; defaults to keep-id for rootless Podman | | ||
| 492 | | `--container-memory <size>` | — | memory limit per job (the runtime's default is the whole machine) | | ||
| 493 | | `--container-cpus <n>` | — | CPU limit per job | | ||
| 494 | | `--container-pids <n>` | — | process limit per job (default 2048, and it cannot be removed) | | ||
| 495 | | `--container-tmpfs <size>` | — | size of the job's /tmp, which is a tmpfs and therefore memory (default 1G) | | ||
| 496 | | `--disk-reserve <size>` | — | free space kept under --dir (default 2G; 0 disables the check) | | ||
| 497 | | `--cache-size <size>` | — | cap for the job cache (default 5G) | | ||
| 498 | | `--git-cache-size <size>` | — | cap for the saved checkouts (default 10G; 0 keeps every one) | | ||
| 499 | | `--no-cache` | — | mount the cache but empty it after every job | | ||
| 500 | | `--known-hosts <path>` | — | a known_hosts file to verify the instance against | | ||
| 501 | | `--insecure-host-key` | — | accept any host key; for tests and throwaway instances only | | ||
| 502 | |||
| 503 | See [CI runners](deploy/runner.md), [Runners](runner.md). | ||
| 504 | |||
| 505 | ### run | ||
| 506 | |||
| 277 | 507 | ```sh | |
| 278 | vole runner --remote <ssh-url> [--once] [--jobs <n>] [--dir <path>] [--repos <name>]... [--label <name>]... | ||
| 279 | [--container-runtime <name>] [--container-network none|bridge] | ||
| 280 | [--container-pull missing|always|never] [--container-user <uid:gid>] [--container-userns <mode>] | ||
| 281 | [--container-memory <size>] [--container-cpus <n>] [--container-pids <n>] | ||
| 282 | [--cache-size <size>] [--git-cache-size <size>] [--no-cache] | ||
| 283 | vole run list [--state <state>] [--branch <branch>] [--commit <sha>] [--limit <n>] | ||
| 284 | [--format <fmt>] [--remote <name|url>] | ||
| 508 | vole run list [--state <state>] [--branch <branch>] [--commit <sha>] [--limit <n>] [--format <fmt>] [--remote <name|url>] | ||
| 285 | 509 | vole run show <id> [--remote <name|url>] | |
| 286 | 510 | vole run logs <id> [--attempt <n>] [--step <n>] [--remote <name|url>] | |
| 287 | 511 | vole run cancel <id> [--remote <name|url>] | |
| 288 | 512 | vole run rerun <id> [--remote <name|url>] | |
| 513 | ``` | ||
| 514 | |||
| 515 | The id is the 26-character one in the run page URL. `run list` narrows by | ||
| 516 | status, branch, or a commit id or prefix. The queue lives on the instance, so | ||
| 517 | every subcommand reads it over the key you push with, and any account that may | ||
| 518 | read the repository may use them. | ||
| 519 | |||
| 520 | `vole change show` lists the head's runs, and the combined result's runs when | ||
| 521 | there is one, so a reviewer can copy a failing id without opening the browser. | ||
| 522 | |||
| 523 | `list` — `--format` understands `%(id)`, `%(shortid)`, `%(status)`, `%(workflow)`, `%(job)`, `%(branch)`, `%(sha)`, `%(trigger)`, `%(trigger_title)`, `%(exit)`, `%(attempts)`, `%(log)` and `%(created)`. | ||
| 524 | |||
| 525 | `show` — Prints the status, commit, trigger, steps with their exit codes and durations, each attempt's log size, the published artifacts, and whether the result counts as a check. | ||
| 526 | |||
| 527 | `logs` — Writes the bytes the runner wrote, with nothing added, so it can be redirected or piped. It opens the attempt the run is on, or the newest logged attempt once the run has finished. | ||
| 528 | |||
| 529 | `cancel` — A queued run is canceled outright; a running one is asked to stop, and its runner stops at the next heartbeat. Only a maintainer or instance admin may cancel, and `data/audit.log` records the account, the repository and the run. | ||
| 530 | |||
| 531 | `rerun` — Queues a finished run again with the same pinned job. Only a maintainer or instance admin may rerun, and the audit log records it. | ||
| 532 | |||
| 533 | | Option | Used by | Meaning | | ||
| 534 | |---|---|---| | ||
| 535 | | `--remote <name\|url>` | all | the remote naming the instance (default origin) | | ||
| 536 | | `--state <state>` | list | queued, running, success, failed, canceled, error, or all | | ||
| 537 | | `--branch <branch>` | list | only runs on this branch | | ||
| 538 | | `--commit <sha>` | list | only runs for this commit id or prefix | | ||
| 539 | | `--limit <n>` | list | how many runs to show (default 20) | | ||
| 540 | | `--format <fmt>` | list | a template such as '%(id) %(status)' | | ||
| 541 | | `--attempt <n>` | logs | which attempt's log; default is the current or newest one | | ||
| 542 | | `--step <n>` | logs | only this step's range of the log | | ||
| 543 | |||
| 544 | See [Workflows](workflows.md), [Runners](runner.md). | ||
| 545 | |||
| 546 | ### workflow | ||
| 547 | |||
| 548 | ```sh | ||
| 289 | 549 | vole workflow check [--dir <path>] | |
| 290 | 550 | vole workflow list [--dir <path>] | |
| 291 | vole workflow run [--dir <path>] [<workflow>...] [--job <id>]... | ||
| 292 | [--container-runtime <name>] | ||
| 293 | [--container-network none|bridge] [--container-pull missing|always|never] | ||
| 294 | [--container-user <uid:gid>] [--container-userns <mode>] | ||
| 295 | [--cache-size <size>] [--no-cache] | ||
| 296 | vole workflow dispatch --remote <name|url> --workflow <path> [--ref <branch>] | ||
| 297 | [--input name=value]... | ||
| 551 | vole workflow run [--dir <path>] [<workflow>...] [--job <id>]... [--container-runtime <name>] [--container-network <mode>] [--container-pull <mode>] [--container-user <uid:gid>] [--container-userns <mode>] [--cache-size <size>] [--no-cache] | ||
| 552 | vole workflow dispatch --remote <name|url> --workflow <path> [--ref <branch>] [--input k=v]... | ||
| 298 | 553 | ``` | |
| 299 | 554 | ||
| 300 | `--jobs` is how many jobs one runner process runs at once (default 1). Each is a | ||
| 301 | session of its own, so the container limits are per job and a machine running four | ||
| 302 | jobs needs room for four containers. Under `--once` the runner still starts `--jobs` | ||
| 303 | jobs, and exits when they all finish. | ||
| 304 | |||
| 305 | `workflow run` executes steps in the working tree, in the job's image. It needs no | ||
| 306 | runner, but it does read the secrets its jobs declare from the instance the | ||
| 307 | checkout's `origin` names, using your key; a value it cannot read is left unset with | ||
| 308 | a note, and the values it did read are masked in the output. It needs a container | ||
| 309 | runtime; there is no host mode. Both it and | ||
| 310 | `vole runner` reuse a job cache (see [Runners § Caching](runner.md#caching)). A | ||
| 311 | runner also keeps a copy of every repository it builds and clones each job from it, | ||
| 312 | so the history crosses the network once rather than once per run (see | ||
| 313 | [Runners § Saved checkouts](runner.md#saved-checkouts)). See | ||
| 314 | [Workflows § Check and run a workflow locally](workflows.md#check-and-run-a-workflow-locally). | ||
| 315 | |||
| 316 | `workflow dispatch` queues a manual run on the instance instead. The workflow must | ||
| 317 | declare `on.workflow-dispatch`; `--ref` defaults to the default branch, and each | ||
| 318 | `--input` is checked against the input's declared type, options, and default. Only | ||
| 319 | a maintainer or instance admin may dispatch. | ||
| 320 | |||
| 321 | `run list`, `run show` and `run logs` are the CLI half of the runs page and a run's | ||
| 322 | log. The queue lives on the instance, so they read it over the key you push with; any | ||
| 323 | account that may read the repository may use them. `run list` defaults to the newest | ||
| 324 | 20 runs and narrows by status, branch or a commit id or prefix. `--format` understands | ||
| 325 | `%(id)`, `%(shortid)`, `%(status)`, `%(workflow)`, `%(job)`, `%(branch)`, `%(sha)`, | ||
| 326 | `%(trigger)`, `%(trigger_title)`, `%(exit)`, `%(attempts)`, `%(log)` and `%(created)`. | ||
| 327 | |||
| 328 | `run show` prints the run's status, commit, trigger, steps with their exit codes and | ||
| 329 | durations, each attempt's log size, the published artifacts, and whether the result | ||
| 330 | counts as a check. The id is the 26-character one on the run page; `vole change show` | ||
| 331 | also lists the head's runs, and the combined result's runs when there is one, so a | ||
| 332 | reviewer can copy the failing id without opening the browser. | ||
| 333 | |||
| 334 | `run logs` writes the bytes the runner wrote to stdout, with nothing added, so it can | ||
| 335 | be redirected or piped. It opens the attempt the run is on, or the newest logged | ||
| 336 | attempt once the run has finished; `--attempt` picks a retry and `--step` narrows the | ||
| 337 | output to one step's range inside it. A refusal goes to stderr, so a redirect produces | ||
| 338 | a log or an empty file. | ||
| 339 | |||
| 340 | `run cancel` is the CLI counterpart of the cancel button on a run page. A queued run | ||
| 341 | is canceled outright, and a running one is asked to stop, with its runner stopping at | ||
| 342 | the next heartbeat. `run rerun` queues a finished run again with the same pinned job. | ||
| 343 | Only a maintainer or instance admin may do either, and `data/audit.log` records the | ||
| 344 | account, the repository, and the run (`run.cancel` or `run.rerun`). | ||
| 555 | A local run executes the steps in the image the workflow names, bound to this | ||
| 556 | working tree, and stops at the first failure. That makes it the run CI performs, | ||
| 557 | not a rehearsal on whatever this machine has installed, so it needs a container | ||
| 558 | runtime. It ignores trigger filters and runs-on, publishes no artifacts, and | ||
| 559 | deploys no site. | ||
| 560 | |||
| 561 | Each job gets a cache at /cache, kept under the user cache directory and reused | ||
| 562 | by later runs of the same repository and image. As on a runner, nothing is | ||
| 563 | cached until the image's env: (or the step) points a tool at /cache; --no-cache | ||
| 564 | mounts it and empties it after every job. | ||
| 565 | |||
| 566 | `check` — The same validator runs in pre-receive, so a file that passes check will not be rejected at push time for its contents. | ||
| 567 | |||
| 568 | `list` — Shows what each workflow in the tree runs on. | ||
| 569 | |||
| 570 | `run` — Runs workflows locally, without a server: the steps run in the job's container against this checkout, and it stops at the first failure. | ||
| 571 | |||
| 572 | `dispatch` — Queues a manual run on the instance; the workflow must declare `on.workflow-dispatch`. Only a maintainer or instance admin may dispatch. | ||
| 573 | |||
| 574 | | Option | Used by | Meaning | | ||
| 575 | |---|---|---| | ||
| 576 | | `-c, --config <path>` | all | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml | | ||
| 577 | | `-C, --dir <path>` | all | the working tree to read .vole/workflows from (default the current directory) | | ||
| 578 | | `--remote <name\|url>` | dispatch | the remote naming the instance | | ||
| 579 | | `--workflow <path>` | dispatch | the workflow file to queue | | ||
| 580 | | `--ref <branch>` | dispatch | the branch to run it on; default the default branch | | ||
| 581 | | `--input <k=v>` | dispatch | a declared input; repeatable | | ||
| 582 | | `-j, --job <id>` | run | only jobs with this id; repeatable | | ||
| 583 | | `--container-runtime <name>` | run | docker (default), podman, or nerdctl | | ||
| 584 | | `--container-network <mode>` | run | none, or bridge (the default for a local run) | | ||
| 585 | | `--container-pull <mode>` | run | missing (default), always, or never | | ||
| 586 | | `--container-user <uid:gid>` | run | the user steps run as | | ||
| 587 | | `--container-userns <mode>` | run | user namespace mode, such as keep-id | | ||
| 588 | | `--cache-size <size>` | run | cap for the reused job cache (default 5G) | | ||
| 589 | | `--no-cache` | run | run with an empty cache | | ||
| 590 | |||
| 591 | See [Workflows](workflows.md), [Workflow reference](reference/workflow-reference.md). | ||
| 345 | 592 | ||
| 346 | 593 | ## Internal | |
| 347 | 594 | ||
| 348 | `vole hook pre-receive|post-receive` is installed in repositories by Vole. It is | ||
| 349 | not intended to be run by hand. | ||
| 595 | ```sh | ||
| 596 | vole hook pre-receive|post-receive | ||
| 597 | ``` | ||
| 598 | |||
| 599 | Installed in each repository's hooks directory and run by git, not by hand. | ||
| 600 | Anything the pre-receive hook cannot verify is a rejected push. | ||
| 601 | |||
| 602 | ## Help and version | ||
| 603 | |||
| 604 | ### help | ||
| 605 | |||
| 606 | ```sh | ||
| 607 | vole help [<command>] | ||
| 608 | ``` | ||
| 609 | |||
| 610 | With no argument, prints the summary `vole help` shows. With a command name, | ||
| 611 | prints that command's usage and options, exactly as `vole <command> -h` does. | ||
| 612 | |||
| 613 | `vole help --markdown` writes the generated CLI reference (docs/cli.md). | ||
| 614 | |||
| 615 | ### version | ||
| 616 | |||
| 617 | ```sh | ||
| 618 | vole version | ||
| 619 | ``` | ||
| 620 | |||
| 621 | The version is set when the binary is built, so a package or release tag | ||
| 622 | decides what it says, not the source tree. | ||