@runveric/cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -28
- package/dist/runveric.mjs +86 -24
- package/dist/runveric.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
production runner image — without pushing anything or signing in.**
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
npx @runveric/cli@0.
|
|
7
|
+
npx @runveric/cli@0.6.0 init --id yourteam/restart-web-tier
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -40,7 +40,7 @@ script outside the platform. Nothing in the product offered that. This does.
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
npx @runveric/cli@0.
|
|
43
|
+
npx @runveric/cli@0.6.0 <command> # no install
|
|
44
44
|
npm install -g @runveric/cli # or install the `runveric` bin
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -63,7 +63,7 @@ Pin the version your Runveric deployment shows you on its Author page rather tha
|
|
|
63
63
|
Scaffold a PowerShell action, look at what you got, validate it, and run it locally:
|
|
64
64
|
|
|
65
65
|
```sh
|
|
66
|
-
$ npx @runveric/cli@0.
|
|
66
|
+
$ npx @runveric/cli@0.6.0 init restart-web-tier \
|
|
67
67
|
--id acme/restart-web-tier \
|
|
68
68
|
--interpreter powershell \
|
|
69
69
|
--yes
|
|
@@ -174,39 +174,49 @@ time through the action protocol, with handlers written against
|
|
|
174
174
|
commands, so the four verbs keep meaning what they mean.
|
|
175
175
|
|
|
176
176
|
```sh
|
|
177
|
-
npx @runveric/cli@0.
|
|
177
|
+
npx @runveric/cli@0.6.0 action init action-azure-disk-snapshot --key azure.disk.snapshot --name "Snapshot Disk"
|
|
178
178
|
cd action-azure-disk-snapshot
|
|
179
|
-
npm install # writes package-lock.json — commit it; the publish workflow runs `npm ci`
|
|
180
|
-
npm test
|
|
179
|
+
npm install # writes package-lock.json — commit it; the publish workflow runs `npm ci --ignore-scripts`
|
|
180
|
+
npm test # type-checks src/, builds dist/index.js, runs the unit tests — no Azure, no network
|
|
181
|
+
npm run test:live # validate, then a dry-run execute, through `action test` with your own az login
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
`action init` writes a repository that builds, tests and publishes with no hand step: `package.json`
|
|
184
|
-
(the SDK pinned exactly to the version this CLI was built against; a `typecheck`
|
|
185
|
-
|
|
186
|
-
`src/index.ts` and the SDK into the one file the runtime loads, `dist/index.js`
|
|
187
|
-
|
|
188
|
-
(`defineAction({ validate, execute, rollback })`,
|
|
189
|
-
before it acts), `
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
(the SDK pinned exactly to the version this CLI was built against; `test` runs a `typecheck` first —
|
|
186
|
+
esbuild strips types, so without it a type error would build and publish — then a build that bundles
|
|
187
|
+
`src/index.ts` and the SDK into the one file the runtime loads, `dist/index.js`, then `test:unit`, the
|
|
188
|
+
action's own vitest suite; `test:live` runs `action test` against Azure), `tsconfig.json` (strict,
|
|
189
|
+
against the installed SDK's types), `src/index.ts` (`defineAction({ validate, execute, rollback })`,
|
|
190
|
+
whose `execute` makes a restore point durable before it acts), `src/assess.ts` (the one pure function
|
|
191
|
+
that turns what was read into checks) and its unit tests, `catalog.yaml` (an engine `execution`, a beta
|
|
192
|
+
version, an `azure/arm` target that depends on its resource group, and the `checks:` it may raise — every
|
|
193
|
+
refusal and decision code, each decision with the words a requester ticks), `README.md`, `.gitignore`,
|
|
194
|
+
the catalog's publish workflow and a pull-request template with the promotion checklist — rendered from
|
|
195
|
+
the same templates, by the same function, as the catalog's own tooling plants them. The directory
|
|
196
|
+
defaults to the repository name the key maps to. It never overwrites a file.
|
|
193
197
|
|
|
194
198
|
`action test` runs ONE phase of the built `dist/index.js` through the real action runtime and a
|
|
195
199
|
**local engine**:
|
|
196
200
|
|
|
197
201
|
```sh
|
|
198
202
|
runveric action test --phase validate --param resourceGroup=rg-example --param resource=example
|
|
199
|
-
runveric action test --phase
|
|
203
|
+
runveric action test --phase validate --params-file test/params.json --expect disk.unreadable
|
|
204
|
+
runveric action test --phase execute --params-file test/params.json [--dry-run] [--decide disk.recentlyChanged]
|
|
200
205
|
runveric action test --phase rollback --params-file test/params.json --prior-result test/prior-result.json
|
|
201
206
|
runveric action test --phase execute --params-file test/params.json --azure-token-from-az
|
|
202
207
|
```
|
|
203
208
|
|
|
209
|
+
Before anything runs, `catalog.yaml` is held to the rules the catalog refuses a manifest for — its
|
|
210
|
+
`checks:` and its one target — by the very functions the platform uses, and every broken rule is named.
|
|
204
211
|
The invocation is built from `catalog.yaml` and the parameters, with the platform's own functions for
|
|
205
212
|
the parameter schema and the one target a run names. Every message the action sends is checked by the
|
|
206
|
-
protocol's own parsers, every checkpoint is acknowledged,
|
|
207
|
-
|
|
208
|
-
checks and the outcome, and exits 1 on a
|
|
209
|
-
|
|
213
|
+
protocol's own parsers, every checkpoint is acknowledged, every code a validate raises must be one
|
|
214
|
+
`catalog.yaml` declares, and an execute's success is held to the engine's rule that a destructive action
|
|
215
|
+
records a restore point first. It prints the events, the checks and the outcome, and exits 1 on a
|
|
216
|
+
protocol violation or a failed outcome. A validate exits 0 only when no check is still at error — or,
|
|
217
|
+
with `--expect <code>` (repeatable), only when exactly those codes were raised — and says why.
|
|
218
|
+
`--decide <code>` (repeatable) gives an execute or a rollback a requester's recorded decision.
|
|
219
|
+
`--prior-result` is the record an execute prints: the restore point it made and its outcome.
|
|
210
220
|
|
|
211
221
|
**Credentials:** none by default — the action's `ctx.azure` refuses with a sentence saying how to give
|
|
212
222
|
one. `--azure-token-from-az` hands it ONE token for Azure Resource Manager from your own
|
|
@@ -218,9 +228,11 @@ tokens.
|
|
|
218
228
|
every message again, and the catalog's release workflow verifies and signs the image before anything
|
|
219
229
|
can run it. Neither happens here, and a local pass does not claim them.
|
|
220
230
|
|
|
221
|
-
Publishing is a tag equal to `catalog.yaml`'s `version
|
|
222
|
-
|
|
223
|
-
and
|
|
231
|
+
Publishing is a tag equal to `catalog.yaml`'s `version`, in two jobs. `build`, which can write nothing,
|
|
232
|
+
installs with `npm ci --ignore-scripts` (no dependency's install script runs), type-checks, builds
|
|
233
|
+
`dist/index.js` and runs `npm run test:unit`. `publish`, which holds the package write, installs nothing: it builds the image from the
|
|
234
|
+
action runtime by digest, pushes it by digest and publishes the catalog artifact. The catalog's release
|
|
235
|
+
workflow then verifies and signs it.
|
|
224
236
|
|
|
225
237
|
---
|
|
226
238
|
|
|
@@ -232,21 +244,21 @@ publish and verify with these commands:
|
|
|
232
244
|
|
|
233
245
|
```sh
|
|
234
246
|
# one action's manifest, verbatim — stdout: <key>=<repository>@<digest>
|
|
235
|
-
npx @runveric/cli@0.
|
|
247
|
+
npx @runveric/cli@0.6.0 catalog publish-action --manifest catalog.yaml \
|
|
236
248
|
--to ghcr.io/<org>/action-azure-vm-stop
|
|
237
249
|
|
|
238
250
|
# an ENGINE action: its manifest and the image its workflow pushed, by digest, to the same package
|
|
239
|
-
npx @runveric/cli@0.
|
|
251
|
+
npx @runveric/cli@0.6.0 catalog publish-action --manifest catalog.yaml \
|
|
240
252
|
--to ghcr.io/<org>/action-azure-publicip-delete-unattached \
|
|
241
253
|
--image ghcr.io/<org>/action-azure-publicip-delete-unattached@sha256:<digest>
|
|
242
254
|
|
|
243
255
|
# a release naming each action artifact by digest — stdout: <repository>@<digest>
|
|
244
|
-
npx @runveric/cli@0.
|
|
256
|
+
npx @runveric/cli@0.6.0 catalog publish-release --from release.yaml --to ghcr.io/<org>/catalog
|
|
245
257
|
|
|
246
258
|
# what the release workflow may sign: each engine action's image, judged by the server's rule
|
|
247
259
|
# — stdout: one <repository>@<digest> per image that passed
|
|
248
|
-
npx @runveric/cli@0.
|
|
249
|
-
npx @runveric/cli@0.
|
|
260
|
+
npx @runveric/cli@0.6.0 catalog verify-image --from release.yaml
|
|
261
|
+
npx @runveric/cli@0.6.0 catalog verify-image <repository>@<digest> --key <action key> --commit <sha>
|
|
250
262
|
```
|
|
251
263
|
|
|
252
264
|
An action's package must be named after its key (`azure.vm.stop` → `action-azure-vm-stop`); the
|