@plexus-ms/cli-ci 0.109.0 → 0.110.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.
Files changed (2) hide show
  1. package/dist/plx-ci.js +14 -7
  2. package/package.json +2 -2
package/dist/plx-ci.js CHANGED
@@ -11173,7 +11173,10 @@ function sidecarArgs(name, port, bucket, storage, readOnly) {
11173
11173
  "-e",
11174
11174
  "REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true",
11175
11175
  "-e",
11176
- readOnly ? "REGISTRY_STORAGE_MAINTENANCE_READONLY_ENABLED=true" : "REGISTRY_STORAGE_DELETE_ENABLED=true",
11176
+ // registry:2 panics on the read-only flag as one nested variable
11177
+ // (…_READONLY_ENABLED=true): the map it builds from it has the wrong
11178
+ // type. The whole key as one YAML value is read as from a config file.
11179
+ readOnly ? 'REGISTRY_STORAGE_MAINTENANCE_READONLY={"enabled":true}' : "REGISTRY_STORAGE_DELETE_ENABLED=true",
11177
11180
  REGISTRY_IMAGE
11178
11181
  ];
11179
11182
  }
@@ -11187,6 +11190,13 @@ async function answers(ctx, port) {
11187
11190
  }
11188
11191
  async function startSidecars(ctx, storage, owner, zone, now = /* @__PURE__ */ new Date()) {
11189
11192
  const buckets = registryBuckets(owner, now);
11193
+ if (!ctx.dryRun && await answers(ctx, CURRENT_PORT)) {
11194
+ const previousAnswers2 = await answers(ctx, PREVIOUS_PORT);
11195
+ ctx.say(`registry: :${CURRENT_PORT} answers already, the host's pair; nothing started`);
11196
+ return { current: buckets.current, previous: buckets.previous, previousAnswers: previousAnswers2 };
11197
+ }
11198
+ if (!storage)
11199
+ throw new Error("REGISTRY_ENDPOINT, REGISTRY_REGION, REGISTRY_ACCESS_KEY and REGISTRY_SECRET_KEY are needed");
11190
11200
  const sos = new Storage(ctx, storage.accessKey, storage.secretKey);
11191
11201
  if (!await sos.bucketExists(buckets.current)) {
11192
11202
  ctx.say(`\u2192 creating the bucket ${buckets.current} in ${zone}`);
@@ -11801,7 +11811,7 @@ runcmd:
11801
11811
  - plexus-ci-exo version >/dev/null
11802
11812
  # The registry sidecars, when the launch named a bucket (ci.md, "The registry"): :5000 on this month's bucket, read-write; :5001 on the previous month's, read-only. The same two containers as .github/ci/registry.sh starts on a GitHub runner.
11803
11813
  - . /etc/plexus-ci/env && if [ -n "$REGISTRY_ENDPOINT" ]; then docker run -d --name registry --restart unless-stopped -p 127.0.0.1:5000:5000 -e REGISTRY_STORAGE=s3 -e REGISTRY_STORAGE_S3_REGIONENDPOINT="$REGISTRY_ENDPOINT" -e REGISTRY_STORAGE_S3_REGION="$REGISTRY_REGION" -e REGISTRY_STORAGE_S3_BUCKET="$REGISTRY_BUCKET" -e REGISTRY_STORAGE_S3_ACCESSKEY="$REGISTRY_ACCESS_KEY" -e REGISTRY_STORAGE_S3_SECRETKEY="$REGISTRY_SECRET_KEY" -e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true -e REGISTRY_STORAGE_DELETE_ENABLED=true registry:2 >/dev/null; fi
11804
- - . /etc/plexus-ci/env && if [ -n "$REGISTRY_ENDPOINT" ]; then docker run -d --name registry-previous --restart on-failure:3 -p 127.0.0.1:5001:5000 -e REGISTRY_STORAGE=s3 -e REGISTRY_STORAGE_S3_REGIONENDPOINT="$REGISTRY_ENDPOINT" -e REGISTRY_STORAGE_S3_REGION="$REGISTRY_REGION" -e REGISTRY_STORAGE_S3_BUCKET="$REGISTRY_PREVIOUS_BUCKET" -e REGISTRY_STORAGE_S3_ACCESSKEY="$REGISTRY_ACCESS_KEY" -e REGISTRY_STORAGE_S3_SECRETKEY="$REGISTRY_SECRET_KEY" -e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true -e REGISTRY_STORAGE_MAINTENANCE_READONLY_ENABLED=true registry:2 >/dev/null; fi
11814
+ - . /etc/plexus-ci/env && if [ -n "$REGISTRY_ENDPOINT" ]; then docker run -d --name registry-previous --restart on-failure:3 -p 127.0.0.1:5001:5000 -e REGISTRY_STORAGE=s3 -e REGISTRY_STORAGE_S3_REGIONENDPOINT="$REGISTRY_ENDPOINT" -e REGISTRY_STORAGE_S3_REGION="$REGISTRY_REGION" -e REGISTRY_STORAGE_S3_BUCKET="$REGISTRY_PREVIOUS_BUCKET" -e REGISTRY_STORAGE_S3_ACCESSKEY="$REGISTRY_ACCESS_KEY" -e REGISTRY_STORAGE_S3_SECRETKEY="$REGISTRY_SECRET_KEY" -e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true -e 'REGISTRY_STORAGE_MAINTENANCE_READONLY={"enabled":true}' registry:2 >/dev/null; fi
11805
11815
  # A builder: the docker driver cannot export a registry cache, so BuildKit runs in its own container on the host's network, where localhost:5000 is the sidecar; bootstrapped now so that the build does not wait for it.
11806
11816
  - . /etc/plexus-ci/env && if [ "$KIND" = build ]; then su -s /bin/bash runner -c 'docker buildx create --name ci --driver docker-container --driver-opt network=host --bootstrap >/dev/null' & fi
11807
11817
  - . /etc/plexus-ci/env && if [ "$KIND" = test ]; then docker pull -q postgres:18.6 >/dev/null & docker pull -q rustfs/rustfs:1.0.4 >/dev/null & fi
@@ -12377,13 +12387,10 @@ function register5(program2) {
12377
12387
  // src/commands/registry.ts
12378
12388
  function register6(program2) {
12379
12389
  const registry = program2.command("registry").description(
12380
- "start the registry sidecars: :5000 on this month\u2019s bucket read-write, :5001 on the previous month\u2019s read-only"
12390
+ "start the registry sidecars: :5000 on this month\u2019s bucket read-write, :5001 on the previous month\u2019s read-only; nothing where :5000 answers"
12381
12391
  ).action(async (_opts, command) => {
12382
12392
  const ctx = contextOf(command);
12383
- const storage = storageFromEnv();
12384
- if (!storage)
12385
- throw new Error("REGISTRY_ENDPOINT, REGISTRY_REGION, REGISTRY_ACCESS_KEY and REGISTRY_SECRET_KEY are needed");
12386
- const result = await startSidecars(ctx, storage, ownerOf(need("GITHUB_REPOSITORY")), zoneOf());
12393
+ const result = await startSidecars(ctx, storageFromEnv(), ownerOf(need("GITHUB_REPOSITORY")), zoneOf());
12387
12394
  ctx.result(
12388
12395
  result,
12389
12396
  (r) => `:5000 ${r.current}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexus-ms/cli-ci",
3
- "version": "0.109.0",
3
+ "version": "0.110.0",
4
4
  "description": "plx-ci, the CI verbs of Plexus: throwaway runners on a cloud, a registry on object storage, reproducible image builds, and their teardown",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "node": ">=24.22.1"
24
24
  },
25
25
  "dependencies": {
26
- "@plexus-ms/lib": "0.109.0",
26
+ "@plexus-ms/lib": "0.110.0",
27
27
  "commander": "^15.0.0",
28
28
  "yaml": "^2.9.1"
29
29
  },