@marinoscar/platform-cli 0.0.0-stage → 0.1.0-next.11
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/CHANGELOG.md +157 -0
- package/LICENSE +21 -0
- package/README.md +182 -2
- package/dist/android/build.d.ts +30 -0
- package/dist/android/build.d.ts.map +1 -0
- package/dist/android/build.js +126 -0
- package/dist/android/build.js.map +1 -0
- package/dist/android/command.d.ts +21 -0
- package/dist/android/command.d.ts.map +1 -0
- package/dist/android/command.js +355 -0
- package/dist/android/command.js.map +1 -0
- package/dist/android/deploy-step.d.ts +85 -0
- package/dist/android/deploy-step.d.ts.map +1 -0
- package/dist/android/deploy-step.js +268 -0
- package/dist/android/deploy-step.js.map +1 -0
- package/dist/android/doctor.d.ts +47 -0
- package/dist/android/doctor.d.ts.map +1 -0
- package/dist/android/doctor.js +219 -0
- package/dist/android/doctor.js.map +1 -0
- package/dist/android/exec.d.ts +42 -0
- package/dist/android/exec.d.ts.map +1 -0
- package/dist/android/exec.js +103 -0
- package/dist/android/exec.js.map +1 -0
- package/dist/android/fix-plan.d.ts +44 -0
- package/dist/android/fix-plan.d.ts.map +1 -0
- package/dist/android/fix-plan.js +86 -0
- package/dist/android/fix-plan.js.map +1 -0
- package/dist/android/git-freshness.d.ts +34 -0
- package/dist/android/git-freshness.d.ts.map +1 -0
- package/dist/android/git-freshness.js +120 -0
- package/dist/android/git-freshness.js.map +1 -0
- package/dist/android/gradle.d.ts +32 -0
- package/dist/android/gradle.d.ts.map +1 -0
- package/dist/android/gradle.js +55 -0
- package/dist/android/gradle.js.map +1 -0
- package/dist/android/identity.d.ts +27 -0
- package/dist/android/identity.d.ts.map +1 -0
- package/dist/android/identity.js +60 -0
- package/dist/android/identity.js.map +1 -0
- package/dist/android/index.d.ts +7 -0
- package/dist/android/index.d.ts.map +1 -0
- package/dist/android/index.js +8 -0
- package/dist/android/index.js.map +1 -0
- package/dist/android/installer.d.ts +28 -0
- package/dist/android/installer.d.ts.map +1 -0
- package/dist/android/installer.js +96 -0
- package/dist/android/installer.js.map +1 -0
- package/dist/android/java.d.ts +26 -0
- package/dist/android/java.d.ts.map +1 -0
- package/dist/android/java.js +65 -0
- package/dist/android/java.js.map +1 -0
- package/dist/android/keystore.d.ts +54 -0
- package/dist/android/keystore.d.ts.map +1 -0
- package/dist/android/keystore.js +159 -0
- package/dist/android/keystore.js.map +1 -0
- package/dist/android/metadata.d.ts +39 -0
- package/dist/android/metadata.d.ts.map +1 -0
- package/dist/android/metadata.js +61 -0
- package/dist/android/metadata.js.map +1 -0
- package/dist/android/operations.d.ts +42 -0
- package/dist/android/operations.d.ts.map +1 -0
- package/dist/android/operations.js +59 -0
- package/dist/android/operations.js.map +1 -0
- package/dist/android/paths.d.ts +29 -0
- package/dist/android/paths.d.ts.map +1 -0
- package/dist/android/paths.js +97 -0
- package/dist/android/paths.js.map +1 -0
- package/dist/android/publish.d.ts +37 -0
- package/dist/android/publish.d.ts.map +1 -0
- package/dist/android/publish.js +119 -0
- package/dist/android/publish.js.map +1 -0
- package/dist/android/registrations.d.ts +92 -0
- package/dist/android/registrations.d.ts.map +1 -0
- package/dist/android/registrations.js +112 -0
- package/dist/android/registrations.js.map +1 -0
- package/dist/android/release-status.d.ts +73 -0
- package/dist/android/release-status.d.ts.map +1 -0
- package/dist/android/release-status.js +161 -0
- package/dist/android/release-status.js.map +1 -0
- package/dist/android/release.d.ts +33 -0
- package/dist/android/release.d.ts.map +1 -0
- package/dist/android/release.js +59 -0
- package/dist/android/release.js.map +1 -0
- package/dist/android/screen-layout.d.ts +26 -0
- package/dist/android/screen-layout.d.ts.map +1 -0
- package/dist/android/screen-layout.js +24 -0
- package/dist/android/screen-layout.js.map +1 -0
- package/dist/android/screen-model.d.ts +56 -0
- package/dist/android/screen-model.d.ts.map +1 -0
- package/dist/android/screen-model.js +207 -0
- package/dist/android/screen-model.js.map +1 -0
- package/dist/android/screen.d.ts +8 -0
- package/dist/android/screen.d.ts.map +1 -0
- package/dist/android/screen.js +395 -0
- package/dist/android/screen.js.map +1 -0
- package/dist/android/sdk.d.ts +48 -0
- package/dist/android/sdk.d.ts.map +1 -0
- package/dist/android/sdk.js +82 -0
- package/dist/android/sdk.js.map +1 -0
- package/dist/android/server-url.d.ts +19 -0
- package/dist/android/server-url.d.ts.map +1 -0
- package/dist/android/server-url.js +36 -0
- package/dist/android/server-url.js.map +1 -0
- package/dist/android/upload-progress.d.ts +3 -0
- package/dist/android/upload-progress.d.ts.map +1 -0
- package/dist/android/upload-progress.js +47 -0
- package/dist/android/upload-progress.js.map +1 -0
- package/dist/android/version.d.ts +47 -0
- package/dist/android/version.d.ts.map +1 -0
- package/dist/android/version.js +136 -0
- package/dist/android/version.js.map +1 -0
- package/dist/api-client/index.d.ts +3 -0
- package/dist/api-client/index.d.ts.map +1 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/index.js.map +1 -0
- package/dist/commands/index.d.ts +52 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +63 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/core/cli-registry.d.ts +41 -0
- package/dist/core/cli-registry.d.ts.map +1 -0
- package/dist/core/cli-registry.js +49 -0
- package/dist/core/cli-registry.js.map +1 -0
- package/dist/core/command-registry.d.ts +60 -0
- package/dist/core/command-registry.d.ts.map +1 -0
- package/dist/core/command-registry.js +114 -0
- package/dist/core/command-registry.js.map +1 -0
- package/dist/core/env-annotation-registry.d.ts +58 -0
- package/dist/core/env-annotation-registry.d.ts.map +1 -0
- package/dist/core/env-annotation-registry.js +80 -0
- package/dist/core/env-annotation-registry.js.map +1 -0
- package/dist/core/env-generator-registry.d.ts +59 -0
- package/dist/core/env-generator-registry.d.ts.map +1 -0
- package/dist/core/env-generator-registry.js +102 -0
- package/dist/core/env-generator-registry.js.map +1 -0
- package/dist/core/env-group-registry.d.ts +65 -0
- package/dist/core/env-group-registry.d.ts.map +1 -0
- package/dist/core/env-group-registry.js +77 -0
- package/dist/core/env-group-registry.js.map +1 -0
- package/dist/core/env-spec-registry.d.ts +133 -0
- package/dist/core/env-spec-registry.d.ts.map +1 -0
- package/dist/core/env-spec-registry.js +103 -0
- package/dist/core/env-spec-registry.js.map +1 -0
- package/dist/core/env-values.d.ts +76 -0
- package/dist/core/env-values.d.ts.map +1 -0
- package/dist/core/env-values.js +125 -0
- package/dist/core/env-values.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/deploy/index.d.ts +3 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +5 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/engine/api-client.d.ts +211 -0
- package/dist/engine/api-client.d.ts.map +1 -0
- package/dist/engine/api-client.js +350 -0
- package/dist/engine/api-client.js.map +1 -0
- package/dist/engine/browser.d.ts +18 -0
- package/dist/engine/browser.d.ts.map +1 -0
- package/dist/engine/browser.js +115 -0
- package/dist/engine/browser.js.map +1 -0
- package/dist/engine/builtin-registrations.d.ts +20 -0
- package/dist/engine/builtin-registrations.d.ts.map +1 -0
- package/dist/engine/builtin-registrations.js +86 -0
- package/dist/engine/builtin-registrations.js.map +1 -0
- package/dist/engine/commands/api.d.ts +88 -0
- package/dist/engine/commands/api.d.ts.map +1 -0
- package/dist/engine/commands/api.js +398 -0
- package/dist/engine/commands/api.js.map +1 -0
- package/dist/engine/commands/config.d.ts +5 -0
- package/dist/engine/commands/config.d.ts.map +1 -0
- package/dist/engine/commands/config.js +83 -0
- package/dist/engine/commands/config.js.map +1 -0
- package/dist/engine/commands/deploy.d.ts +243 -0
- package/dist/engine/commands/deploy.d.ts.map +1 -0
- package/dist/engine/commands/deploy.js +1166 -0
- package/dist/engine/commands/deploy.js.map +1 -0
- package/dist/engine/commands/init.d.ts +18 -0
- package/dist/engine/commands/init.d.ts.map +1 -0
- package/dist/engine/commands/init.js +50 -0
- package/dist/engine/commands/init.js.map +1 -0
- package/dist/engine/commands/login.d.ts +4 -0
- package/dist/engine/commands/login.d.ts.map +1 -0
- package/dist/engine/commands/login.js +205 -0
- package/dist/engine/commands/login.js.map +1 -0
- package/dist/engine/commands/node.d.ts +21 -0
- package/dist/engine/commands/node.d.ts.map +1 -0
- package/dist/engine/commands/node.js +436 -0
- package/dist/engine/commands/node.js.map +1 -0
- package/dist/engine/config.d.ts +246 -0
- package/dist/engine/config.d.ts.map +1 -0
- package/dist/engine/config.js +414 -0
- package/dist/engine/config.js.map +1 -0
- package/dist/engine/conformance.d.ts +187 -0
- package/dist/engine/conformance.d.ts.map +1 -0
- package/dist/engine/conformance.js +227 -0
- package/dist/engine/conformance.js.map +1 -0
- package/dist/engine/create-cli.d.ts +94 -0
- package/dist/engine/create-cli.d.ts.map +1 -0
- package/dist/engine/create-cli.js +60 -0
- package/dist/engine/create-cli.js.map +1 -0
- package/dist/engine/deploy/about.d.ts +12 -0
- package/dist/engine/deploy/about.d.ts.map +1 -0
- package/dist/engine/deploy/about.js +110 -0
- package/dist/engine/deploy/about.js.map +1 -0
- package/dist/engine/deploy/adopt.d.ts +21 -0
- package/dist/engine/deploy/adopt.d.ts.map +1 -0
- package/dist/engine/deploy/adopt.js +78 -0
- package/dist/engine/deploy/adopt.js.map +1 -0
- package/dist/engine/deploy/answers-file.d.ts +7 -0
- package/dist/engine/deploy/answers-file.d.ts.map +1 -0
- package/dist/engine/deploy/answers-file.js +49 -0
- package/dist/engine/deploy/answers-file.js.map +1 -0
- package/dist/engine/deploy/app-role.d.ts +278 -0
- package/dist/engine/deploy/app-role.d.ts.map +1 -0
- package/dist/engine/deploy/app-role.js +826 -0
- package/dist/engine/deploy/app-role.js.map +1 -0
- package/dist/engine/deploy/app-version.d.ts +47 -0
- package/dist/engine/deploy/app-version.d.ts.map +1 -0
- package/dist/engine/deploy/app-version.js +232 -0
- package/dist/engine/deploy/app-version.js.map +1 -0
- package/dist/engine/deploy/checks/database.d.ts +83 -0
- package/dist/engine/deploy/checks/database.d.ts.map +1 -0
- package/dist/engine/deploy/checks/database.js +455 -0
- package/dist/engine/deploy/checks/database.js.map +1 -0
- package/dist/engine/deploy/checks/dns.d.ts +3 -0
- package/dist/engine/deploy/checks/dns.d.ts.map +1 -0
- package/dist/engine/deploy/checks/dns.js +85 -0
- package/dist/engine/deploy/checks/dns.js.map +1 -0
- package/dist/engine/deploy/checks/host.d.ts +19 -0
- package/dist/engine/deploy/checks/host.d.ts.map +1 -0
- package/dist/engine/deploy/checks/host.js +543 -0
- package/dist/engine/deploy/checks/host.js.map +1 -0
- package/dist/engine/deploy/checks/index.d.ts +33 -0
- package/dist/engine/deploy/checks/index.d.ts.map +1 -0
- package/dist/engine/deploy/checks/index.js +67 -0
- package/dist/engine/deploy/checks/index.js.map +1 -0
- package/dist/engine/deploy/checks/registry.d.ts +110 -0
- package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
- package/dist/engine/deploy/checks/registry.js +104 -0
- package/dist/engine/deploy/checks/registry.js.map +1 -0
- package/dist/engine/deploy/checks/source.d.ts +45 -0
- package/dist/engine/deploy/checks/source.d.ts.map +1 -0
- package/dist/engine/deploy/checks/source.js +175 -0
- package/dist/engine/deploy/checks/source.js.map +1 -0
- package/dist/engine/deploy/checks/tls.d.ts +87 -0
- package/dist/engine/deploy/checks/tls.d.ts.map +1 -0
- package/dist/engine/deploy/checks/tls.js +552 -0
- package/dist/engine/deploy/checks/tls.js.map +1 -0
- package/dist/engine/deploy/checks/types.d.ts +186 -0
- package/dist/engine/deploy/checks/types.d.ts.map +1 -0
- package/dist/engine/deploy/checks/types.js +199 -0
- package/dist/engine/deploy/checks/types.js.map +1 -0
- package/dist/engine/deploy/compose-files.d.ts +29 -0
- package/dist/engine/deploy/compose-files.d.ts.map +1 -0
- package/dist/engine/deploy/compose-files.js +118 -0
- package/dist/engine/deploy/compose-files.js.map +1 -0
- package/dist/engine/deploy/compose-hints.d.ts +11 -0
- package/dist/engine/deploy/compose-hints.d.ts.map +1 -0
- package/dist/engine/deploy/compose-hints.js +70 -0
- package/dist/engine/deploy/compose-hints.js.map +1 -0
- package/dist/engine/deploy/consent.d.ts +29 -0
- package/dist/engine/deploy/consent.d.ts.map +1 -0
- package/dist/engine/deploy/consent.js +35 -0
- package/dist/engine/deploy/consent.js.map +1 -0
- package/dist/engine/deploy/database-drop.d.ts +22 -0
- package/dist/engine/deploy/database-drop.d.ts.map +1 -0
- package/dist/engine/deploy/database-drop.js +135 -0
- package/dist/engine/deploy/database-drop.js.map +1 -0
- package/dist/engine/deploy/database.d.ts +116 -0
- package/dist/engine/deploy/database.d.ts.map +1 -0
- package/dist/engine/deploy/database.js +252 -0
- package/dist/engine/deploy/database.js.map +1 -0
- package/dist/engine/deploy/deploy-info.d.ts +48 -0
- package/dist/engine/deploy/deploy-info.d.ts.map +1 -0
- package/dist/engine/deploy/deploy-info.js +163 -0
- package/dist/engine/deploy/deploy-info.js.map +1 -0
- package/dist/engine/deploy/deployment-evidence.d.ts +38 -0
- package/dist/engine/deploy/deployment-evidence.d.ts.map +1 -0
- package/dist/engine/deploy/deployment-evidence.js +92 -0
- package/dist/engine/deploy/deployment-evidence.js.map +1 -0
- package/dist/engine/deploy/edge-config.d.ts +103 -0
- package/dist/engine/deploy/edge-config.d.ts.map +1 -0
- package/dist/engine/deploy/edge-config.js +170 -0
- package/dist/engine/deploy/edge-config.js.map +1 -0
- package/dist/engine/deploy/env-absence.d.ts +61 -0
- package/dist/engine/deploy/env-absence.d.ts.map +1 -0
- package/dist/engine/deploy/env-absence.js +33 -0
- package/dist/engine/deploy/env-absence.js.map +1 -0
- package/dist/engine/deploy/env-file.d.ts +14 -0
- package/dist/engine/deploy/env-file.d.ts.map +1 -0
- package/dist/engine/deploy/env-file.js +58 -0
- package/dist/engine/deploy/env-file.js.map +1 -0
- package/dist/engine/deploy/env-fragments.d.ts +29 -0
- package/dist/engine/deploy/env-fragments.d.ts.map +1 -0
- package/dist/engine/deploy/env-fragments.js +73 -0
- package/dist/engine/deploy/env-fragments.js.map +1 -0
- package/dist/engine/deploy/env-metadata.d.ts +73 -0
- package/dist/engine/deploy/env-metadata.d.ts.map +1 -0
- package/dist/engine/deploy/env-metadata.js +227 -0
- package/dist/engine/deploy/env-metadata.js.map +1 -0
- package/dist/engine/deploy/env-spec.d.ts +75 -0
- package/dist/engine/deploy/env-spec.d.ts.map +1 -0
- package/dist/engine/deploy/env-spec.js +239 -0
- package/dist/engine/deploy/env-spec.js.map +1 -0
- package/dist/engine/deploy/env-wizard.d.ts +56 -0
- package/dist/engine/deploy/env-wizard.d.ts.map +1 -0
- package/dist/engine/deploy/env-wizard.js +235 -0
- package/dist/engine/deploy/env-wizard.js.map +1 -0
- package/dist/engine/deploy/executor.d.ts +81 -0
- package/dist/engine/deploy/executor.d.ts.map +1 -0
- package/dist/engine/deploy/executor.js +247 -0
- package/dist/engine/deploy/executor.js.map +1 -0
- package/dist/engine/deploy/health.d.ts +153 -0
- package/dist/engine/deploy/health.d.ts.map +1 -0
- package/dist/engine/deploy/health.js +335 -0
- package/dist/engine/deploy/health.js.map +1 -0
- package/dist/engine/deploy/hooks.d.ts +66 -0
- package/dist/engine/deploy/hooks.d.ts.map +1 -0
- package/dist/engine/deploy/hooks.js +19 -0
- package/dist/engine/deploy/hooks.js.map +1 -0
- package/dist/engine/deploy/host-facts.d.ts +23 -0
- package/dist/engine/deploy/host-facts.d.ts.map +1 -0
- package/dist/engine/deploy/host-facts.js +67 -0
- package/dist/engine/deploy/host-facts.js.map +1 -0
- package/dist/engine/deploy/install.d.ts +233 -0
- package/dist/engine/deploy/install.d.ts.map +1 -0
- package/dist/engine/deploy/install.js +1318 -0
- package/dist/engine/deploy/install.js.map +1 -0
- package/dist/engine/deploy/inventory.d.ts +30 -0
- package/dist/engine/deploy/inventory.d.ts.map +1 -0
- package/dist/engine/deploy/inventory.js +122 -0
- package/dist/engine/deploy/inventory.js.map +1 -0
- package/dist/engine/deploy/journal.d.ts +77 -0
- package/dist/engine/deploy/journal.d.ts.map +1 -0
- package/dist/engine/deploy/journal.js +221 -0
- package/dist/engine/deploy/journal.js.map +1 -0
- package/dist/engine/deploy/layout.d.ts +77 -0
- package/dist/engine/deploy/layout.d.ts.map +1 -0
- package/dist/engine/deploy/layout.js +191 -0
- package/dist/engine/deploy/layout.js.map +1 -0
- package/dist/engine/deploy/oauth-check.d.ts +58 -0
- package/dist/engine/deploy/oauth-check.d.ts.map +1 -0
- package/dist/engine/deploy/oauth-check.js +213 -0
- package/dist/engine/deploy/oauth-check.js.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts +149 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.js +416 -0
- package/dist/engine/deploy/proxy-bootstrap.js.map +1 -0
- package/dist/engine/deploy/proxy-streams.d.ts +110 -0
- package/dist/engine/deploy/proxy-streams.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-streams.js +208 -0
- package/dist/engine/deploy/proxy-streams.js.map +1 -0
- package/dist/engine/deploy/proxy.d.ts +375 -0
- package/dist/engine/deploy/proxy.d.ts.map +1 -0
- package/dist/engine/deploy/proxy.js +758 -0
- package/dist/engine/deploy/proxy.js.map +1 -0
- package/dist/engine/deploy/renewal.d.ts +54 -0
- package/dist/engine/deploy/renewal.d.ts.map +1 -0
- package/dist/engine/deploy/renewal.js +169 -0
- package/dist/engine/deploy/renewal.js.map +1 -0
- package/dist/engine/deploy/repo.d.ts +119 -0
- package/dist/engine/deploy/repo.d.ts.map +1 -0
- package/dist/engine/deploy/repo.js +277 -0
- package/dist/engine/deploy/repo.js.map +1 -0
- package/dist/engine/deploy/run-record.d.ts +28 -0
- package/dist/engine/deploy/run-record.d.ts.map +1 -0
- package/dist/engine/deploy/run-record.js +44 -0
- package/dist/engine/deploy/run-record.js.map +1 -0
- package/dist/engine/deploy/state.d.ts +289 -0
- package/dist/engine/deploy/state.d.ts.map +1 -0
- package/dist/engine/deploy/state.js +163 -0
- package/dist/engine/deploy/state.js.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts +24 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.js +45 -0
- package/dist/engine/deploy/steps/app-step-context.js.map +1 -0
- package/dist/engine/deploy/steps/pipeline.d.ts +46 -0
- package/dist/engine/deploy/steps/pipeline.d.ts.map +1 -0
- package/dist/engine/deploy/steps/pipeline.js +73 -0
- package/dist/engine/deploy/steps/pipeline.js.map +1 -0
- package/dist/engine/deploy/steps/plan.d.ts +28 -0
- package/dist/engine/deploy/steps/plan.d.ts.map +1 -0
- package/dist/engine/deploy/steps/plan.js +32 -0
- package/dist/engine/deploy/steps/plan.js.map +1 -0
- package/dist/engine/deploy/steps/registry.d.ts +182 -0
- package/dist/engine/deploy/steps/registry.d.ts.map +1 -0
- package/dist/engine/deploy/steps/registry.js +212 -0
- package/dist/engine/deploy/steps/registry.js.map +1 -0
- package/dist/engine/deploy/steps/step-values.d.ts +28 -0
- package/dist/engine/deploy/steps/step-values.d.ts.map +1 -0
- package/dist/engine/deploy/steps/step-values.js +33 -0
- package/dist/engine/deploy/steps/step-values.js.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts +88 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.js +236 -0
- package/dist/engine/deploy/testing/fake-postgres.js.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts +147 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.js +365 -0
- package/dist/engine/deploy/testing/fake-vps.js.map +1 -0
- package/dist/engine/deploy/uninstall.d.ts +87 -0
- package/dist/engine/deploy/uninstall.d.ts.map +1 -0
- package/dist/engine/deploy/uninstall.js +321 -0
- package/dist/engine/deploy/uninstall.js.map +1 -0
- package/dist/engine/deploy/update.d.ts +112 -0
- package/dist/engine/deploy/update.d.ts.map +1 -0
- package/dist/engine/deploy/update.js +1280 -0
- package/dist/engine/deploy/update.js.map +1 -0
- package/dist/engine/deploy/version-step.d.ts +65 -0
- package/dist/engine/deploy/version-step.d.ts.map +1 -0
- package/dist/engine/deploy/version-step.js +176 -0
- package/dist/engine/deploy/version-step.js.map +1 -0
- package/dist/engine/device-auth.d.ts +240 -0
- package/dist/engine/device-auth.d.ts.map +1 -0
- package/dist/engine/device-auth.js +442 -0
- package/dist/engine/device-auth.js.map +1 -0
- package/dist/engine/device-login.d.ts +126 -0
- package/dist/engine/device-login.d.ts.map +1 -0
- package/dist/engine/device-login.js +164 -0
- package/dist/engine/device-login.js.map +1 -0
- package/dist/engine/errors.d.ts +314 -0
- package/dist/engine/errors.d.ts.map +1 -0
- package/dist/engine/errors.js +561 -0
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/identity.d.ts +169 -0
- package/dist/engine/identity.d.ts.map +1 -0
- package/dist/engine/identity.js +227 -0
- package/dist/engine/identity.js.map +1 -0
- package/dist/engine/index.d.ts +104 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +126 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/init/local-profile.d.ts +93 -0
- package/dist/engine/init/local-profile.d.ts.map +1 -0
- package/dist/engine/init/local-profile.js +295 -0
- package/dist/engine/init/local-profile.js.map +1 -0
- package/dist/engine/init/run-init.d.ts +41 -0
- package/dist/engine/init/run-init.d.ts.map +1 -0
- package/dist/engine/init/run-init.js +297 -0
- package/dist/engine/init/run-init.js.map +1 -0
- package/dist/engine/node/capabilities.d.ts +238 -0
- package/dist/engine/node/capabilities.d.ts.map +1 -0
- package/dist/engine/node/capabilities.js +316 -0
- package/dist/engine/node/capabilities.js.map +1 -0
- package/dist/engine/node/daemon.d.ts +63 -0
- package/dist/engine/node/daemon.d.ts.map +1 -0
- package/dist/engine/node/daemon.js +227 -0
- package/dist/engine/node/daemon.js.map +1 -0
- package/dist/engine/node/doctor.d.ts +58 -0
- package/dist/engine/node/doctor.d.ts.map +1 -0
- package/dist/engine/node/doctor.js +394 -0
- package/dist/engine/node/doctor.js.map +1 -0
- package/dist/engine/node/enrollment.d.ts +98 -0
- package/dist/engine/node/enrollment.d.ts.map +1 -0
- package/dist/engine/node/enrollment.js +189 -0
- package/dist/engine/node/enrollment.js.map +1 -0
- package/dist/engine/node/env-flags.d.ts +5 -0
- package/dist/engine/node/env-flags.d.ts.map +1 -0
- package/dist/engine/node/env-flags.js +22 -0
- package/dist/engine/node/env-flags.js.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts +63 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.js +189 -0
- package/dist/engine/node/executors/credential-hygiene.js.map +1 -0
- package/dist/engine/node/executors/db-backup-run.d.ts +73 -0
- package/dist/engine/node/executors/db-backup-run.d.ts.map +1 -0
- package/dist/engine/node/executors/db-backup-run.js +362 -0
- package/dist/engine/node/executors/db-backup-run.js.map +1 -0
- package/dist/engine/node/executors/example-checksum.d.ts +30 -0
- package/dist/engine/node/executors/example-checksum.d.ts.map +1 -0
- package/dist/engine/node/executors/example-checksum.js +56 -0
- package/dist/engine/node/executors/example-checksum.js.map +1 -0
- package/dist/engine/node/executors/index.d.ts +168 -0
- package/dist/engine/node/executors/index.d.ts.map +1 -0
- package/dist/engine/node/executors/index.js +44 -0
- package/dist/engine/node/executors/index.js.map +1 -0
- package/dist/engine/node/executors/registry.d.ts +38 -0
- package/dist/engine/node/executors/registry.d.ts.map +1 -0
- package/dist/engine/node/executors/registry.js +92 -0
- package/dist/engine/node/executors/registry.js.map +1 -0
- package/dist/engine/node/heap-snapshot.d.ts +37 -0
- package/dist/engine/node/heap-snapshot.d.ts.map +1 -0
- package/dist/engine/node/heap-snapshot.js +160 -0
- package/dist/engine/node/heap-snapshot.js.map +1 -0
- package/dist/engine/node/install-deps.d.ts +73 -0
- package/dist/engine/node/install-deps.d.ts.map +1 -0
- package/dist/engine/node/install-deps.js +150 -0
- package/dist/engine/node/install-deps.js.map +1 -0
- package/dist/engine/node/ipc-protocol.d.ts +67 -0
- package/dist/engine/node/ipc-protocol.d.ts.map +1 -0
- package/dist/engine/node/ipc-protocol.js +83 -0
- package/dist/engine/node/ipc-protocol.js.map +1 -0
- package/dist/engine/node/lifecycle.d.ts +103 -0
- package/dist/engine/node/lifecycle.d.ts.map +1 -0
- package/dist/engine/node/lifecycle.js +259 -0
- package/dist/engine/node/lifecycle.js.map +1 -0
- package/dist/engine/node/logger.d.ts +82 -0
- package/dist/engine/node/logger.d.ts.map +1 -0
- package/dist/engine/node/logger.js +241 -0
- package/dist/engine/node/logger.js.map +1 -0
- package/dist/engine/node/memory-watchdog.d.ts +78 -0
- package/dist/engine/node/memory-watchdog.d.ts.map +1 -0
- package/dist/engine/node/memory-watchdog.js +224 -0
- package/dist/engine/node/memory-watchdog.js.map +1 -0
- package/dist/engine/node/node-api.d.ts +391 -0
- package/dist/engine/node/node-api.d.ts.map +1 -0
- package/dist/engine/node/node-api.js +123 -0
- package/dist/engine/node/node-api.js.map +1 -0
- package/dist/engine/node/node-config.d.ts +128 -0
- package/dist/engine/node/node-config.d.ts.map +1 -0
- package/dist/engine/node/node-config.js +237 -0
- package/dist/engine/node/node-config.js.map +1 -0
- package/dist/engine/node/node-dashboard-source.d.ts +56 -0
- package/dist/engine/node/node-dashboard-source.d.ts.map +1 -0
- package/dist/engine/node/node-dashboard-source.js +213 -0
- package/dist/engine/node/node-dashboard-source.js.map +1 -0
- package/dist/engine/node/node-engine.d.ts +229 -0
- package/dist/engine/node/node-engine.d.ts.map +1 -0
- package/dist/engine/node/node-engine.js +723 -0
- package/dist/engine/node/node-engine.js.map +1 -0
- package/dist/engine/node/node-errors.d.ts +54 -0
- package/dist/engine/node/node-errors.d.ts.map +1 -0
- package/dist/engine/node/node-errors.js +71 -0
- package/dist/engine/node/node-errors.js.map +1 -0
- package/dist/engine/node/node-events.d.ts +132 -0
- package/dist/engine/node/node-events.d.ts.map +1 -0
- package/dist/engine/node/node-events.js +2 -0
- package/dist/engine/node/node-events.js.map +1 -0
- package/dist/engine/node/node-vitals.d.ts +123 -0
- package/dist/engine/node/node-vitals.d.ts.map +1 -0
- package/dist/engine/node/node-vitals.js +266 -0
- package/dist/engine/node/node-vitals.js.map +1 -0
- package/dist/engine/node/paths.d.ts +39 -0
- package/dist/engine/node/paths.d.ts.map +1 -0
- package/dist/engine/node/paths.js +60 -0
- package/dist/engine/node/paths.js.map +1 -0
- package/dist/engine/node/pg-dump.d.ts +126 -0
- package/dist/engine/node/pg-dump.d.ts.map +1 -0
- package/dist/engine/node/pg-dump.js +223 -0
- package/dist/engine/node/pg-dump.js.map +1 -0
- package/dist/engine/node/pidfile.d.ts +38 -0
- package/dist/engine/node/pidfile.d.ts.map +1 -0
- package/dist/engine/node/pidfile.js +156 -0
- package/dist/engine/node/pidfile.js.map +1 -0
- package/dist/engine/node/runtime-tuning.d.ts +65 -0
- package/dist/engine/node/runtime-tuning.d.ts.map +1 -0
- package/dist/engine/node/runtime-tuning.js +198 -0
- package/dist/engine/node/runtime-tuning.js.map +1 -0
- package/dist/engine/node/service.d.ts +39 -0
- package/dist/engine/node/service.d.ts.map +1 -0
- package/dist/engine/node/service.js +211 -0
- package/dist/engine/node/service.js.map +1 -0
- package/dist/engine/node/start.d.ts +62 -0
- package/dist/engine/node/start.d.ts.map +1 -0
- package/dist/engine/node/start.js +245 -0
- package/dist/engine/node/start.js.map +1 -0
- package/dist/engine/node/worker-env-table.d.ts +15 -0
- package/dist/engine/node/worker-env-table.d.ts.map +1 -0
- package/dist/engine/node/worker-env-table.js +97 -0
- package/dist/engine/node/worker-env-table.js.map +1 -0
- package/dist/engine/node/worker-env.d.ts +50 -0
- package/dist/engine/node/worker-env.d.ts.map +1 -0
- package/dist/engine/node/worker-env.js +101 -0
- package/dist/engine/node/worker-env.js.map +1 -0
- package/dist/engine/output.d.ts +97 -0
- package/dist/engine/output.d.ts.map +1 -0
- package/dist/engine/output.js +274 -0
- package/dist/engine/output.js.map +1 -0
- package/dist/engine/package-info.d.ts +7 -0
- package/dist/engine/package-info.d.ts.map +1 -0
- package/dist/engine/package-info.js +38 -0
- package/dist/engine/package-info.js.map +1 -0
- package/dist/engine/program.d.ts +50 -0
- package/dist/engine/program.d.ts.map +1 -0
- package/dist/engine/program.js +197 -0
- package/dist/engine/program.js.map +1 -0
- package/dist/engine/prompt.d.ts +69 -0
- package/dist/engine/prompt.d.ts.map +1 -0
- package/dist/engine/prompt.js +205 -0
- package/dist/engine/prompt.js.map +1 -0
- package/dist/engine/registries.d.ts +5 -0
- package/dist/engine/registries.d.ts.map +1 -0
- package/dist/engine/registries.js +52 -0
- package/dist/engine/registries.js.map +1 -0
- package/dist/engine/request-body.d.ts +31 -0
- package/dist/engine/request-body.d.ts.map +1 -0
- package/dist/engine/request-body.js +156 -0
- package/dist/engine/request-body.js.map +1 -0
- package/dist/engine/test-support.d.ts +50 -0
- package/dist/engine/test-support.d.ts.map +1 -0
- package/dist/engine/test-support.js +86 -0
- package/dist/engine/test-support.js.map +1 -0
- package/dist/engine/tui/app.d.ts +3 -0
- package/dist/engine/tui/app.d.ts.map +1 -0
- package/dist/engine/tui/app.js +100 -0
- package/dist/engine/tui/app.js.map +1 -0
- package/dist/engine/tui/builtin-screens.d.ts +6 -0
- package/dist/engine/tui/builtin-screens.d.ts.map +1 -0
- package/dist/engine/tui/builtin-screens.js +54 -0
- package/dist/engine/tui/builtin-screens.js.map +1 -0
- package/dist/engine/tui/index.d.ts +23 -0
- package/dist/engine/tui/index.d.ts.map +1 -0
- package/dist/engine/tui/index.js +71 -0
- package/dist/engine/tui/index.js.map +1 -0
- package/dist/engine/tui/layout.d.ts +132 -0
- package/dist/engine/tui/layout.d.ts.map +1 -0
- package/dist/engine/tui/layout.js +200 -0
- package/dist/engine/tui/layout.js.map +1 -0
- package/dist/engine/tui/routes.d.ts +5 -0
- package/dist/engine/tui/routes.d.ts.map +1 -0
- package/dist/engine/tui/routes.js +16 -0
- package/dist/engine/tui/routes.js.map +1 -0
- package/dist/engine/tui/screen-registry.d.ts +100 -0
- package/dist/engine/tui/screen-registry.d.ts.map +1 -0
- package/dist/engine/tui/screen-registry.js +96 -0
- package/dist/engine/tui/screen-registry.js.map +1 -0
- package/dist/engine/tui/screen-sections.d.ts +9 -0
- package/dist/engine/tui/screen-sections.d.ts.map +1 -0
- package/dist/engine/tui/screen-sections.js +45 -0
- package/dist/engine/tui/screen-sections.js.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts +69 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js +228 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts +37 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js +89 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.js +155 -0
- package/dist/engine/tui/screens/deploy/doctor.js.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts +123 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.js +202 -0
- package/dist/engine/tui/screens/deploy/fields.js.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts +67 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.js +302 -0
- package/dist/engine/tui/screens/deploy/flags-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/index.d.ts +6 -0
- package/dist/engine/tui/screens/deploy/index.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/index.js +83 -0
- package/dist/engine/tui/screens/deploy/index.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts +159 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.js +319 -0
- package/dist/engine/tui/screens/deploy/install-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install.js +361 -0
- package/dist/engine/tui/screens/deploy/install.js.map +1 -0
- package/dist/engine/tui/screens/deploy/model.d.ts +49 -0
- package/dist/engine/tui/screens/deploy/model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/model.js +59 -0
- package/dist/engine/tui/screens/deploy/model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts +58 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.js +117 -0
- package/dist/engine/tui/screens/deploy/run-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run.d.ts +75 -0
- package/dist/engine/tui/screens/deploy/run.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run.js +201 -0
- package/dist/engine/tui/screens/deploy/run.js.map +1 -0
- package/dist/engine/tui/screens/deploy/status.d.ts +17 -0
- package/dist/engine/tui/screens/deploy/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/status.js +107 -0
- package/dist/engine/tui/screens/deploy/status.js.map +1 -0
- package/dist/engine/tui/screens/deploy/update.d.ts +41 -0
- package/dist/engine/tui/screens/deploy/update.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/update.js +175 -0
- package/dist/engine/tui/screens/deploy/update.js.map +1 -0
- package/dist/engine/tui/screens/deploy.d.ts +12 -0
- package/dist/engine/tui/screens/deploy.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy.js +23 -0
- package/dist/engine/tui/screens/deploy.js.map +1 -0
- package/dist/engine/tui/screens/invoke.d.ts +6 -0
- package/dist/engine/tui/screens/invoke.d.ts.map +1 -0
- package/dist/engine/tui/screens/invoke.js +193 -0
- package/dist/engine/tui/screens/invoke.js.map +1 -0
- package/dist/engine/tui/screens/login.d.ts +6 -0
- package/dist/engine/tui/screens/login.d.ts.map +1 -0
- package/dist/engine/tui/screens/login.js +255 -0
- package/dist/engine/tui/screens/login.js.map +1 -0
- package/dist/engine/tui/screens/logout.d.ts +6 -0
- package/dist/engine/tui/screens/logout.d.ts.map +1 -0
- package/dist/engine/tui/screens/logout.js +142 -0
- package/dist/engine/tui/screens/logout.js.map +1 -0
- package/dist/engine/tui/screens/menu.d.ts +22 -0
- package/dist/engine/tui/screens/menu.d.ts.map +1 -0
- package/dist/engine/tui/screens/menu.js +84 -0
- package/dist/engine/tui/screens/menu.js.map +1 -0
- package/dist/engine/tui/screens/node.d.ts +6 -0
- package/dist/engine/tui/screens/node.d.ts.map +1 -0
- package/dist/engine/tui/screens/node.js +228 -0
- package/dist/engine/tui/screens/node.js.map +1 -0
- package/dist/engine/tui/screens/status.d.ts +6 -0
- package/dist/engine/tui/screens/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/status.js +134 -0
- package/dist/engine/tui/screens/status.js.map +1 -0
- package/dist/engine/tui/scroll-box.d.ts +27 -0
- package/dist/engine/tui/scroll-box.d.ts.map +1 -0
- package/dist/engine/tui/scroll-box.js +52 -0
- package/dist/engine/tui/scroll-box.js.map +1 -0
- package/dist/engine/tui/section-registry.d.ts +65 -0
- package/dist/engine/tui/section-registry.d.ts.map +1 -0
- package/dist/engine/tui/section-registry.js +90 -0
- package/dist/engine/tui/section-registry.js.map +1 -0
- package/dist/engine/tui/terminal.d.ts +31 -0
- package/dist/engine/tui/terminal.d.ts.map +1 -0
- package/dist/engine/tui/terminal.js +142 -0
- package/dist/engine/tui/terminal.js.map +1 -0
- package/dist/engine/tui/tty.d.ts +49 -0
- package/dist/engine/tui/tty.d.ts.map +1 -0
- package/dist/engine/tui/tty.js +139 -0
- package/dist/engine/tui/tty.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +5 -0
- package/dist/node/index.js.map +1 -0
- package/dist/telemetry/env-fragment.d.ts +47 -0
- package/dist/telemetry/env-fragment.d.ts.map +1 -0
- package/dist/telemetry/env-fragment.js +73 -0
- package/dist/telemetry/env-fragment.js.map +1 -0
- package/dist/telemetry/index.d.ts +7 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +7 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/node-span-relay.d.ts +107 -0
- package/dist/telemetry/node-span-relay.d.ts.map +1 -0
- package/dist/telemetry/node-span-relay.js +314 -0
- package/dist/telemetry/node-span-relay.js.map +1 -0
- package/dist/telemetry/node-span.d.ts +92 -0
- package/dist/telemetry/node-span.d.ts.map +1 -0
- package/dist/telemetry/node-span.js +28 -0
- package/dist/telemetry/node-span.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +5 -0
- package/dist/tui/index.js.map +1 -0
- package/package.json +102 -4
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { cliName } from '../identity.js';
|
|
4
|
+
import { UsageError } from '../errors.js';
|
|
5
|
+
import { probe } from './checks/host.js';
|
|
6
|
+
import { gitCredentialStateFor, isHttpsGithubUrl, nonInteractiveGitEnv } from './checks/source.js';
|
|
7
|
+
/**
|
|
8
|
+
* Strips a trailing `.git` and any credentials, without changing the scheme.
|
|
9
|
+
*
|
|
10
|
+
* THE SCHEME IS PRESERVED DELIBERATELY. Rewriting ssh to https breaks a server
|
|
11
|
+
* whose access is a deploy key; rewriting https to ssh breaks one that has no
|
|
12
|
+
* key at all. Whichever the operator already uses is the one that works.
|
|
13
|
+
*/
|
|
14
|
+
export function normaliseRepoUrl(url) {
|
|
15
|
+
const trimmed = url.trim().replace(/\.git$/, '');
|
|
16
|
+
// A token in the URL must never reach a log line or an error message.
|
|
17
|
+
return trimmed.replace(/^(https?:\/\/)[^@/]+@/, '$1');
|
|
18
|
+
}
|
|
19
|
+
/** True when the URL carries embedded credentials that must not be printed. */
|
|
20
|
+
export function hasEmbeddedCredentials(url) {
|
|
21
|
+
return /^https?:\/\/[^@/]+@/.test(url);
|
|
22
|
+
}
|
|
23
|
+
/** Redacts credentials for display. */
|
|
24
|
+
export function displayRepoUrl(url) {
|
|
25
|
+
return url.replace(/^(https?:\/\/)[^@/]+@/, '$1***@');
|
|
26
|
+
}
|
|
27
|
+
/** Walks up from `cwd` looking for a .git directory or file. */
|
|
28
|
+
export function findGitRoot(cwd) {
|
|
29
|
+
let current = resolve(cwd);
|
|
30
|
+
for (;;) {
|
|
31
|
+
// `.git` is a directory in a normal clone and a FILE in a worktree, so
|
|
32
|
+
// existsSync rather than a directory test.
|
|
33
|
+
if (existsSync(join(current, '.git')))
|
|
34
|
+
return current;
|
|
35
|
+
const parent = dirname(current);
|
|
36
|
+
if (parent === current)
|
|
37
|
+
return undefined;
|
|
38
|
+
current = parent;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function git(options, args) {
|
|
42
|
+
try {
|
|
43
|
+
const result = await options.runCommand(['git', ...args], {
|
|
44
|
+
cwd: options.cwd,
|
|
45
|
+
timeoutMs: 30_000,
|
|
46
|
+
});
|
|
47
|
+
return result.stdout.trim();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Works out what to deploy.
|
|
55
|
+
*
|
|
56
|
+
* Order: an explicit flag, then the recorded state, then the local checkout.
|
|
57
|
+
*
|
|
58
|
+
* State beats the checkout so that an `update` redeploys WHAT WAS INSTALLED.
|
|
59
|
+
* An install pinned to a tag must not be quietly moved to whatever branch the
|
|
60
|
+
* operator's shell happens to be on.
|
|
61
|
+
*/
|
|
62
|
+
export async function resolveRepoTarget(options) {
|
|
63
|
+
if (options.repoFlag !== undefined) {
|
|
64
|
+
return {
|
|
65
|
+
url: normaliseRepoUrl(options.repoFlag),
|
|
66
|
+
ref: options.refFlag ?? (await defaultRefFor(options, options.repoFlag)) ?? 'main',
|
|
67
|
+
source: 'flag',
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (options.state !== undefined) {
|
|
71
|
+
return {
|
|
72
|
+
url: options.state.repoUrl,
|
|
73
|
+
ref: options.refFlag ?? options.state.ref,
|
|
74
|
+
source: 'state',
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const root = findGitRoot(options.cwd);
|
|
78
|
+
if (root === undefined) {
|
|
79
|
+
throw new UsageError(`Not inside a git checkout, so there is no repository to deploy. Pass --repo <url> (and --ref if you need a branch or tag other than the default).`);
|
|
80
|
+
}
|
|
81
|
+
const scoped = { cwd: root, runCommand: options.runCommand };
|
|
82
|
+
const origin = await git(scoped, ['remote', 'get-url', 'origin']);
|
|
83
|
+
if (origin === undefined || origin === '') {
|
|
84
|
+
throw new UsageError(`This checkout has no \`origin\` remote, so ${cliName()} cannot tell what to deploy. Pass --repo <url>.`);
|
|
85
|
+
}
|
|
86
|
+
const ref = options.refFlag ??
|
|
87
|
+
(await git(scoped, ['rev-parse', '--abbrev-ref', 'HEAD'])) ??
|
|
88
|
+
(await remoteDefaultBranch(scoped));
|
|
89
|
+
if (ref === undefined || ref === '' || ref === 'HEAD') {
|
|
90
|
+
// A detached HEAD, or a repository whose default branch cannot be read.
|
|
91
|
+
// Guessing "main" here is how you deploy the wrong code on a fork that
|
|
92
|
+
// uses master or develop.
|
|
93
|
+
throw new UsageError(`Could not work out which branch to deploy from this checkout. Pass --ref <branch|tag|sha>.`);
|
|
94
|
+
}
|
|
95
|
+
return { url: normaliseRepoUrl(origin), ref, source: 'git-remote' };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Only the repository URL, by the same precedence as `resolveRepoTarget`
|
|
99
|
+
* (flag, then recorded state, then the checkout's `origin`), for callers that
|
|
100
|
+
* need to know WHERE the code comes from but not which ref -- the doctor
|
|
101
|
+
* checks that ask whether git can authenticate to it.
|
|
102
|
+
*
|
|
103
|
+
* Never throws and resolves no ref, so it runs no more git than it has to:
|
|
104
|
+
* `undefined` when nothing names a repository. Normalised, so it carries no
|
|
105
|
+
* embedded credential.
|
|
106
|
+
*/
|
|
107
|
+
export async function resolveRepoUrl(options) {
|
|
108
|
+
if (options.repoFlag !== undefined)
|
|
109
|
+
return normaliseRepoUrl(options.repoFlag);
|
|
110
|
+
if (options.state?.repoUrl !== undefined)
|
|
111
|
+
return normaliseRepoUrl(options.state.repoUrl);
|
|
112
|
+
const root = findGitRoot(options.cwd);
|
|
113
|
+
if (root === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
const origin = await git({ cwd: root, runCommand: options.runCommand }, ['remote', 'get-url', 'origin']);
|
|
116
|
+
return origin === undefined || origin === '' ? undefined : normaliseRepoUrl(origin);
|
|
117
|
+
}
|
|
118
|
+
async function defaultRefFor(options, _url) {
|
|
119
|
+
const root = findGitRoot(options.cwd);
|
|
120
|
+
if (root === undefined)
|
|
121
|
+
return undefined;
|
|
122
|
+
return await remoteDefaultBranch({ cwd: root, runCommand: options.runCommand });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The remote's own default branch.
|
|
126
|
+
*
|
|
127
|
+
* NEVER ASSUMED TO BE `main`. A fork may use master, develop, or anything
|
|
128
|
+
* else, and deploying the wrong branch is the kind of mistake that looks like
|
|
129
|
+
* a successful deployment.
|
|
130
|
+
*/
|
|
131
|
+
async function remoteDefaultBranch(scoped) {
|
|
132
|
+
const symbolic = await git(scoped, ['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']);
|
|
133
|
+
return symbolic?.replace(/^origin\//, '');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The deployment checkout's HEAD right now, or undefined when it cannot be read.
|
|
137
|
+
*
|
|
138
|
+
* Recorded as `DeployState.deployedHead` at the end of every successful run;
|
|
139
|
+
* see that field for why it is measured rather than copied.
|
|
140
|
+
*/
|
|
141
|
+
export async function checkoutHead(deployRoot, run) {
|
|
142
|
+
const sha = await git({ cwd: join(deployRoot, 'repo'), runCommand: run }, ['rev-parse', 'HEAD']);
|
|
143
|
+
return sha === undefined || sha === '' ? undefined : sha;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Whether the deployment already runs what the checkout now holds.
|
|
147
|
+
*
|
|
148
|
+
* Unchanged ONLY when the checkout did not move AND it is still at the last
|
|
149
|
+
* successfully deployed revision. `fetch` moves the checkout before anything is
|
|
150
|
+
* built, so "did not move" alone is also true of a retry after a failed run.
|
|
151
|
+
*
|
|
152
|
+
* With no recorded marker (a state file from before `deployedHead`) the answer
|
|
153
|
+
* is the previous rule: an unmoved checkout is up to date.
|
|
154
|
+
*/
|
|
155
|
+
export function isAlreadyDeployed(checkout, deployedHead) {
|
|
156
|
+
if (checkout.changed)
|
|
157
|
+
return false;
|
|
158
|
+
if (deployedHead === undefined || deployedHead === '')
|
|
159
|
+
return true;
|
|
160
|
+
return deployedHead === checkout.sha;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Clones or updates the checkout, idempotently.
|
|
164
|
+
*
|
|
165
|
+
* The same call performs a first install and every later update, which is what
|
|
166
|
+
* lets #180 and #182 share it rather than each doing half of it differently.
|
|
167
|
+
*/
|
|
168
|
+
export async function ensureCheckout(target, options) {
|
|
169
|
+
const path = join(options.deployRoot, 'repo');
|
|
170
|
+
const scoped = { cwd: path, runCommand: options.runCommand };
|
|
171
|
+
const exists = existsSync(join(path, '.git'));
|
|
172
|
+
if (!exists) {
|
|
173
|
+
// Before the FIRST clone only: a fetch reuses whatever the clone used.
|
|
174
|
+
const gh = await configureGhCredentials(target.url, options.runCommand);
|
|
175
|
+
if (gh === 'configured') {
|
|
176
|
+
options.hooks?.onProgress?.('Configured git to use the GitHub CLI\'s credentials (gh auth setup-git)');
|
|
177
|
+
}
|
|
178
|
+
options.hooks?.onProgress?.(`Cloning ${displayRepoUrl(target.url)}`);
|
|
179
|
+
await runGit(options, options.deployRoot, [
|
|
180
|
+
'clone',
|
|
181
|
+
'--no-checkout',
|
|
182
|
+
target.url,
|
|
183
|
+
path,
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
options.hooks?.onProgress?.('Fetching');
|
|
188
|
+
await runGit(options, path, ['fetch', '--tags', '--prune', 'origin']);
|
|
189
|
+
}
|
|
190
|
+
const previousSha = exists ? await git(scoped, ['rev-parse', 'HEAD']) : undefined;
|
|
191
|
+
if (exists && options.force !== true) {
|
|
192
|
+
const dirty = await git(scoped, ['status', '--porcelain']);
|
|
193
|
+
if (dirty !== undefined && dirty !== '') {
|
|
194
|
+
// Someone hand-patched a file on the server. Resetting over it silently
|
|
195
|
+
// is how a fix disappears and nobody knows why the bug came back.
|
|
196
|
+
throw new UsageError(`The checkout at ${path} has uncommitted changes:\n` +
|
|
197
|
+
dirty
|
|
198
|
+
.split('\n')
|
|
199
|
+
.map((line) => ` ${line}`)
|
|
200
|
+
.join('\n') +
|
|
201
|
+
`\nCommit or remove them, or re-run with --force to discard them.`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const resolved = await resolveRef(scoped, target.ref);
|
|
205
|
+
if (resolved === undefined) {
|
|
206
|
+
throw new UsageError(`\`${target.ref}\` is not a branch, tag or commit in ${displayRepoUrl(target.url)}.`);
|
|
207
|
+
}
|
|
208
|
+
// A hard reset rather than a merge: a deployed checkout is not a development
|
|
209
|
+
// tree, and a merge conflict on a server is worse than a discarded local
|
|
210
|
+
// change that --force already had to allow.
|
|
211
|
+
await runGit(options, path, ['checkout', '--force', '--detach', resolved]);
|
|
212
|
+
const sha = (await git(scoped, ['rev-parse', 'HEAD'])) ?? resolved;
|
|
213
|
+
return {
|
|
214
|
+
previousSha,
|
|
215
|
+
sha,
|
|
216
|
+
changed: previousSha !== sha,
|
|
217
|
+
path,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Lets the GitHub CLI supply clone credentials, when that is what is needed
|
|
222
|
+
* (#391).
|
|
223
|
+
*
|
|
224
|
+
* Only for an HTTPS GitHub URL that git cannot already read, and only when
|
|
225
|
+
* `gh auth status` says gh is logged in: then `gh auth setup-git` registers gh
|
|
226
|
+
* as git's credential helper for that host. The clone itself is still a plain
|
|
227
|
+
* `git clone` -- `gh repo clone` was rejected because it makes gh a hard
|
|
228
|
+
* prerequisite even for a public repository, and breaks a server whose access
|
|
229
|
+
* is an SSH deploy key.
|
|
230
|
+
*
|
|
231
|
+
* Never throws: every outcome ends with the clone being attempted exactly as
|
|
232
|
+
* before, and a clone that still cannot authenticate says so itself.
|
|
233
|
+
*/
|
|
234
|
+
export async function configureGhCredentials(url, run) {
|
|
235
|
+
if (!isHttpsGithubUrl(url))
|
|
236
|
+
return 'not-applicable';
|
|
237
|
+
if ((await gitCredentialStateFor(url, run)) !== false)
|
|
238
|
+
return 'already-readable';
|
|
239
|
+
const env = nonInteractiveGitEnv();
|
|
240
|
+
const status = await probe({ runCommand: run }, ['gh', 'auth', 'status'], { env });
|
|
241
|
+
if (!status.ok)
|
|
242
|
+
return 'gh-unavailable';
|
|
243
|
+
const setup = await probe({ runCommand: run }, ['gh', 'auth', 'setup-git'], { env, timeoutMs: 30_000 });
|
|
244
|
+
return setup.ok ? 'configured' : 'gh-unavailable';
|
|
245
|
+
}
|
|
246
|
+
/** Resolves a branch, tag or SHA to a commit, preferring the remote branch. */
|
|
247
|
+
async function resolveRef(scoped, ref) {
|
|
248
|
+
for (const candidate of [`refs/remotes/origin/${ref}`, `refs/tags/${ref}`, ref]) {
|
|
249
|
+
const sha = await git(scoped, ['rev-parse', '--verify', '--quiet', `${candidate}^{commit}`]);
|
|
250
|
+
if (sha !== undefined && sha !== '')
|
|
251
|
+
return sha;
|
|
252
|
+
}
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
/** Runs git, turning an auth failure into something an operator can act on. */
|
|
256
|
+
async function runGit(options, cwd, args) {
|
|
257
|
+
try {
|
|
258
|
+
const result = await options.runCommand(['git', ...args], {
|
|
259
|
+
cwd,
|
|
260
|
+
timeoutMs: 15 * 60_000,
|
|
261
|
+
...(options.hooks?.onLog === undefined
|
|
262
|
+
? {}
|
|
263
|
+
: { onLine: (line) => options.hooks?.onLog?.(line) }),
|
|
264
|
+
});
|
|
265
|
+
void result;
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
269
|
+
// The most common first-install failure by a wide margin, and the raw git
|
|
270
|
+
// output does not say what to do about it.
|
|
271
|
+
if (/authentication|permission denied|could not read Username|publickey/i.test(message)) {
|
|
272
|
+
throw new UsageError(`git could not authenticate. This server needs read access to the repository — add a deploy key, or use an https URL with a credential helper.\n${message}`);
|
|
273
|
+
}
|
|
274
|
+
throw error;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../../src/engine/deploy/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM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M,CACnB,OAAwB,EACxB,GAAW,EACX,IAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,EAAE;YACxD,GAAG;YACH,SAAS,EAAE,EAAE,GAAG,MAAM;YACtB,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS;gBACpC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;SAChE,CAAC,CAAC;QACH,KAAK,MAAM,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvE,0EAA0E;QAC1E,2CAA2C;QAC3C,IAAI,qEAAqE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACxF,MAAM,IAAI,UAAU,CAClB,kJAAkJ,OAAO,EAAE,CAC5J,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DeployInfoInput } from './deploy-info.js';
|
|
2
|
+
import type { runCommand as defaultRunCommand } from './executor.js';
|
|
3
|
+
import type { DeployProxyFacts } from './state.js';
|
|
4
|
+
export interface ObserveProxyOptions {
|
|
5
|
+
domain: string | undefined;
|
|
6
|
+
bindPort: number;
|
|
7
|
+
proxyRoot: string;
|
|
8
|
+
mode: 'container' | 'host' | undefined;
|
|
9
|
+
container: string | undefined;
|
|
10
|
+
runCommand: typeof defaultRunCommand;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The proxy facts recorded in the deployment state on success.
|
|
14
|
+
*
|
|
15
|
+
* The certificate expiry is READ FROM THE CERTIFICATE (`certificateExpiry`),
|
|
16
|
+
* never computed from an issuance date, and only when a domain is set -- a
|
|
17
|
+
* deployment that is not published has no certificate to describe.
|
|
18
|
+
*/
|
|
19
|
+
export declare function observeProxy(options: ObserveProxyOptions): Promise<DeployProxyFacts>;
|
|
20
|
+
/**
|
|
21
|
+
* The info.json `proxy` object for recorded proxy facts.
|
|
22
|
+
*
|
|
23
|
+
* `undefined` (written as `null`) when the deployment is not published: with
|
|
24
|
+
* no domain, nothing proxies it, and a mode/container pair would describe a
|
|
25
|
+
* proxy that has nothing to do with this deployment.
|
|
26
|
+
*/
|
|
27
|
+
export declare function proxyInfoOf(proxy: DeployProxyFacts | undefined): DeployInfoInput['proxy'];
|
|
28
|
+
//# sourceMappingURL=run-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/run-record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAWnD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,OAAO,iBAAiB,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsB1F;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAClC,eAAe,CAAC,OAAO,CAAC,CAO1B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { certificateExpiry } from './proxy.js';
|
|
2
|
+
/**
|
|
3
|
+
* The proxy facts recorded in the deployment state on success.
|
|
4
|
+
*
|
|
5
|
+
* The certificate expiry is READ FROM THE CERTIFICATE (`certificateExpiry`),
|
|
6
|
+
* never computed from an issuance date, and only when a domain is set -- a
|
|
7
|
+
* deployment that is not published has no certificate to describe.
|
|
8
|
+
*/
|
|
9
|
+
export async function observeProxy(options) {
|
|
10
|
+
let certificateExpiresAt = null;
|
|
11
|
+
if (options.domain !== undefined) {
|
|
12
|
+
try {
|
|
13
|
+
const expiry = await certificateExpiry({ domain: options.domain, bindPort: options.bindPort, proxyRoot: options.proxyRoot }, { runCommand: options.runCommand });
|
|
14
|
+
certificateExpiresAt = expiry.notAfter?.toISOString() ?? null;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Not known is an honest answer; a failed deploy over it is not.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
domain: options.domain ?? null,
|
|
22
|
+
bindPort: options.bindPort,
|
|
23
|
+
mode: options.mode ?? null,
|
|
24
|
+
container: options.container ?? null,
|
|
25
|
+
certificateExpiresAt,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The info.json `proxy` object for recorded proxy facts.
|
|
30
|
+
*
|
|
31
|
+
* `undefined` (written as `null`) when the deployment is not published: with
|
|
32
|
+
* no domain, nothing proxies it, and a mode/container pair would describe a
|
|
33
|
+
* proxy that has nothing to do with this deployment.
|
|
34
|
+
*/
|
|
35
|
+
export function proxyInfoOf(proxy) {
|
|
36
|
+
if (proxy === undefined || proxy.domain === null)
|
|
37
|
+
return undefined;
|
|
38
|
+
return {
|
|
39
|
+
mode: proxy.mode,
|
|
40
|
+
container: proxy.container,
|
|
41
|
+
certificateExpiresAt: proxy.certificateExpiresAt,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=run-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record.js","sourceRoot":"","sources":["../../../src/engine/deploy/run-record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAqB/C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAA4B;IAC7D,IAAI,oBAAoB,GAAkB,IAAI,CAAC;IAE/C,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CACpC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,EACpF,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CACnC,CAAC;YACF,oBAAoB,GAAG,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC;QAChE,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACpC,oBAAoB;KACrB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,KAAmC;IAEnC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACnE,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { CliError, type ExitCode } from '../errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bumped only when a field changes meaning; unknown versions are refused.
|
|
4
|
+
*
|
|
5
|
+
* ⚠ 2 SINCE ISSUE #392, AND EVERY OLDER VERSION IS UPGRADED FORWARD, NEVER
|
|
6
|
+
* REFUSED. A bump alone would make this CLI refuse every state file already on
|
|
7
|
+
* a live server; `upgradeState` is the migration path that makes the bump
|
|
8
|
+
* safe, and every version this CLI ever wrote must keep a branch in it.
|
|
9
|
+
*
|
|
10
|
+
* The one direction that cannot be helped is backwards: once a v2 file is
|
|
11
|
+
* written, an OLDER appctl refuses it with its own "upgrade appctl" message,
|
|
12
|
+
* which is the refusal this rule exists for.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEPLOY_STATE_VERSION = 2;
|
|
15
|
+
/** How many successful runs `history` keeps, newest first. */
|
|
16
|
+
export declare const DEPLOY_HISTORY_LIMIT = 20;
|
|
17
|
+
/**
|
|
18
|
+
* The deploy state file's name under the deployment root. FIXED, whatever the
|
|
19
|
+
* CLI identity: it is read from live servers, so a renamed CLI must still find
|
|
20
|
+
* the file an `appctl` deploy wrote (#715). `identity.test.ts` pins it.
|
|
21
|
+
*
|
|
22
|
+
* @stability stable
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEPLOY_STATE_FILENAME = ".appctl-deploy.json";
|
|
25
|
+
/**
|
|
26
|
+
* The machine a deployment runs on, as last observed by a successful run.
|
|
27
|
+
*
|
|
28
|
+
* Every field is `null` when it could not be determined -- see
|
|
29
|
+
* `collectHostFacts`, which never throws. Nothing here is a secret.
|
|
30
|
+
*/
|
|
31
|
+
export interface HostFacts {
|
|
32
|
+
hostname: string | null;
|
|
33
|
+
/** `PRETTY_NAME` from /etc/os-release, else `os.type()`. */
|
|
34
|
+
os: string | null;
|
|
35
|
+
/** `os.release()`. */
|
|
36
|
+
kernel: string | null;
|
|
37
|
+
arch: string | null;
|
|
38
|
+
cpus: number | null;
|
|
39
|
+
memoryBytes: number | null;
|
|
40
|
+
dockerVersion: string | null;
|
|
41
|
+
composeVersion: string | null;
|
|
42
|
+
capturedAt: string | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One SUCCESSFUL install or update.
|
|
46
|
+
*
|
|
47
|
+
* ⚠ SUCCESS-ONLY, by construction rather than by filtering: an entry is
|
|
48
|
+
* appended only on the success path, so a failed run leaves the list exactly
|
|
49
|
+
* as it found it. `lastOutcome`/`lastFailedStep` are where failures live.
|
|
50
|
+
*/
|
|
51
|
+
export interface DeploymentHistoryEntry {
|
|
52
|
+
/** ISO-8601 finish time. */
|
|
53
|
+
at: string;
|
|
54
|
+
command: 'install' | 'update';
|
|
55
|
+
commitSha: string | null;
|
|
56
|
+
/** What this run replaced; null for a first install. */
|
|
57
|
+
previousCommitSha: string | null;
|
|
58
|
+
ref: string | null;
|
|
59
|
+
durationMs: number | null;
|
|
60
|
+
cliVersion: string | null;
|
|
61
|
+
outcome: 'success';
|
|
62
|
+
}
|
|
63
|
+
/** How this deployment is published, as last observed by a successful run. */
|
|
64
|
+
export interface DeployProxyFacts {
|
|
65
|
+
domain: string | null;
|
|
66
|
+
bindPort: number | null;
|
|
67
|
+
mode: 'container' | 'host' | null;
|
|
68
|
+
container: string | null;
|
|
69
|
+
/** ISO-8601, read from the certificate itself; null with no domain or no readable cert. */
|
|
70
|
+
certificateExpiresAt: string | null;
|
|
71
|
+
}
|
|
72
|
+
export interface DeployState {
|
|
73
|
+
version: typeof DEPLOY_STATE_VERSION;
|
|
74
|
+
/** Resolved from the checkout's own origin; never hardcoded. See #179. */
|
|
75
|
+
repoUrl: string;
|
|
76
|
+
/** Branch, tag or SHA that was requested. */
|
|
77
|
+
ref: string;
|
|
78
|
+
/** The commit actually deployed. */
|
|
79
|
+
commitSha: string;
|
|
80
|
+
/** Public hostname the shared proxy serves this under, if published. */
|
|
81
|
+
domain?: string | undefined;
|
|
82
|
+
/** Loopback port the proxy forwards to. */
|
|
83
|
+
bindPort: number;
|
|
84
|
+
deployRoot: string;
|
|
85
|
+
installedAt: string;
|
|
86
|
+
lastDeployedAt: string;
|
|
87
|
+
lastCommand: 'install' | 'update';
|
|
88
|
+
/** Which appctl wrote this, for diagnosing a state file from the future. */
|
|
89
|
+
appctlVersion: string;
|
|
90
|
+
/** The revision this replaced, for a manual roll-back. */
|
|
91
|
+
previousSha?: string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* The checkout's HEAD when the last SUCCESSFUL install or update finished:
|
|
94
|
+
* the last revision this deployment is known to have been built, migrated and
|
|
95
|
+
* started from.
|
|
96
|
+
*
|
|
97
|
+
* ⚠ WHY THIS IS NOT `commitSha`. `update`'s `fetch` step hard-resets the
|
|
98
|
+
* CHECKOUT to the new revision BEFORE build, migrate and restart, so after a
|
|
99
|
+
* failed run the checkout sits on a revision that never deployed. Comparing
|
|
100
|
+
* the checkout with itself ("did HEAD move?") then reports "already up to
|
|
101
|
+
* date" on the retry and skips every step. `update` therefore treats the
|
|
102
|
+
* deployment as unchanged only when the checkout did not move AND it is
|
|
103
|
+
* still at this revision.
|
|
104
|
+
*
|
|
105
|
+
* ⚠ MEASURED AFTER THE RUN (`git rev-parse HEAD` in the checkout), not copied
|
|
106
|
+
* from `commitSha`. The version step commits a bump on top of the fetched
|
|
107
|
+
* revision and `publish-version` either pushes it (the remote becomes that
|
|
108
|
+
* commit) or rolls it back out (HEAD returns to the fetched revision);
|
|
109
|
+
* `commitSha` names the bump commit in both cases. HEAD at the end is exactly
|
|
110
|
+
* what the next `fetch` finds for an unmoved remote, so the comparison can
|
|
111
|
+
* never fail forever and rebuild on every cron tick.
|
|
112
|
+
*
|
|
113
|
+
* Written ONLY on success. Absent in every state file written before it
|
|
114
|
+
* existed, and then `update` keeps its previous rule (an unmoved checkout is
|
|
115
|
+
* an up-to-date deployment). Optional, and the state version is deliberately
|
|
116
|
+
* NOT bumped for it.
|
|
117
|
+
*/
|
|
118
|
+
deployedHead?: string | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* The shared reverse-proxy root this deployment's vhost was written into.
|
|
121
|
+
*
|
|
122
|
+
* Recorded because it cannot be re-derived: a deployment installed with a
|
|
123
|
+
* non-default `--proxy-root` was silently rewritten to
|
|
124
|
+
* `<deployRoot>/../../proxy` on every update, putting the vhost somewhere the
|
|
125
|
+
* proxy does not read.
|
|
126
|
+
*/
|
|
127
|
+
proxyRoot?: string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* How the shared proxy ran when this deployment last published through it:
|
|
130
|
+
* `container` (nginx in a container, certbot dockerised) or `host`.
|
|
131
|
+
*
|
|
132
|
+
* Recorded so `update`, `certs` and `uninstall` act under the SAME runtime
|
|
133
|
+
* install detected or was told, rather than re-detecting on a server whose
|
|
134
|
+
* proxy happens to be stopped at that moment. A flag still overrides it.
|
|
135
|
+
* Absent means "not recorded" -- the reader detects, as install did.
|
|
136
|
+
*
|
|
137
|
+
* Optional, and ⚠ the state version is deliberately NOT bumped for it (a
|
|
138
|
+
* later issue does that deliberately): a bump makes this CLI refuse every
|
|
139
|
+
* state file already on a live server.
|
|
140
|
+
*/
|
|
141
|
+
proxyMode?: 'container' | 'host' | undefined;
|
|
142
|
+
/** The proxy container's name, alongside `proxyMode`. Same rules. */
|
|
143
|
+
proxyContainer?: string | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* The Docker Compose project this deployment's containers live under.
|
|
146
|
+
*
|
|
147
|
+
* ⚠ Recorded, never derived. Naming an existing deployment's project renames
|
|
148
|
+
* it, and Compose then sees no existing containers and builds a parallel
|
|
149
|
+
* stack that collides with the old one on the bind port. Absent means
|
|
150
|
+
* `compose` -- the directory-derived default every deployment in the field is
|
|
151
|
+
* already running under -- so an adopted deployment keeps working untouched
|
|
152
|
+
* and only a fresh install gets a name of its own.
|
|
153
|
+
*/
|
|
154
|
+
composeProject?: string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* When this record was rebuilt from the deployment itself, because none was
|
|
157
|
+
* found. A THIRD axis, deliberately separate from `installedAt` and
|
|
158
|
+
* `lastDeployedAt`: an adopted deployment has certainly deployed, but
|
|
159
|
+
* nothing on disk says when, and a fabricated instant is worse than an
|
|
160
|
+
* honest gap. Its presence is what lets a reader tell "adopted, earlier
|
|
161
|
+
* history unknown" from "installed then, last deployed then".
|
|
162
|
+
*/
|
|
163
|
+
adoptedAt?: string | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Feature groups this deployment runs with.
|
|
166
|
+
*
|
|
167
|
+
* `observability` is always on (#567) and is written into every record
|
|
168
|
+
* install and update produce; a record from before that lacks it and gets
|
|
169
|
+
* it on the next update (`effectiveGroups` in compose-files.ts). The other
|
|
170
|
+
* groups are opt-in.
|
|
171
|
+
*
|
|
172
|
+
* Recorded because it CANNOT be inferred later. Nothing in a `.env`
|
|
173
|
+
* distinguishes `OTEL_ENABLED=true` from `OTEL_ENABLED=false` - both are
|
|
174
|
+
* merely PRESENT - so an update that guessed would write a group's
|
|
175
|
+
* placeholder defaults into a live deployment. Absent means no opt-in
|
|
176
|
+
* group, which is the correct reading for every state file written before
|
|
177
|
+
* this field existed.
|
|
178
|
+
*
|
|
179
|
+
* Optional, and the state version is deliberately NOT bumped for it: a bump
|
|
180
|
+
* makes this CLI refuse every state file already sitting on a live server.
|
|
181
|
+
*/
|
|
182
|
+
groups?: string[] | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Step ids that completed, so `--resume` can skip them.
|
|
185
|
+
*
|
|
186
|
+
* A rerun after a fixed database password should not rebuild images.
|
|
187
|
+
*/
|
|
188
|
+
completedSteps?: string[] | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* How the last run ended.
|
|
191
|
+
*
|
|
192
|
+
* ⚠ READ AS `=== 'failure'`, NEVER `!== 'success'`. Every state file written
|
|
193
|
+
* before this field existed has it ABSENT, and those runs all succeeded --
|
|
194
|
+
* that is the only way they came to be written at all. A negated test would
|
|
195
|
+
* classify every deployment in the field as a failed one, and `--resume`
|
|
196
|
+
* would then skip steps against a deployment that is serving.
|
|
197
|
+
*
|
|
198
|
+
* Optional, and ⚠ the state version is deliberately NOT bumped for it: a
|
|
199
|
+
* bump makes this CLI refuse every state file already on a live server.
|
|
200
|
+
*/
|
|
201
|
+
lastOutcome?: 'success' | 'failure' | undefined;
|
|
202
|
+
/** The step that failed, named so the operator is told where to look. */
|
|
203
|
+
lastFailedStep?: string | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* When a run was last ATTEMPTED, as distinct from when one last succeeded.
|
|
206
|
+
*
|
|
207
|
+
* `lastDeployedAt` answers "what is running"; this answers "what was tried".
|
|
208
|
+
* Collapsing them would report a failed attempt as a deployment.
|
|
209
|
+
*/
|
|
210
|
+
lastAttemptAt?: string | undefined;
|
|
211
|
+
/** The host as last observed by a successful run (v2, issue #392). */
|
|
212
|
+
host?: HostFacts | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Successful runs, NEWEST FIRST, capped at `DEPLOY_HISTORY_LIMIT`.
|
|
215
|
+
* Appended only on success -- see `appendHistory`. (v2, issue #392.)
|
|
216
|
+
*/
|
|
217
|
+
history?: DeploymentHistoryEntry[] | undefined;
|
|
218
|
+
/** The published proxy as last observed by a successful run (v2, issue #392). */
|
|
219
|
+
proxy?: DeployProxyFacts | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* The operator chose to run the API as a superuser or BYPASSRLS login
|
|
222
|
+
* (`--allow-superuser`, #980). Recorded so `deploy doctor`, which only reads
|
|
223
|
+
* this file, reports `database-role-ordinary` as a warning that names the
|
|
224
|
+
* consequence instead of a failure for a choice already made. Optional, and
|
|
225
|
+
* the state version is deliberately NOT bumped for it.
|
|
226
|
+
*/
|
|
227
|
+
allowSuperuser?: boolean | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* The login `allowSuperuser` was chosen for. The choice applies only while
|
|
230
|
+
* `.env` still holds this POSTGRES_USER (see `superuserAllowedFor`), so it can
|
|
231
|
+
* never outlive the login it was made for.
|
|
232
|
+
*/
|
|
233
|
+
allowSuperuserLogin?: string | undefined;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Nothing is installed at this path.
|
|
237
|
+
*
|
|
238
|
+
* EXIT.USAGE: the command was pointed somewhere it cannot work, and the remedy
|
|
239
|
+
* is to run a different command. #178 introduces EXIT.PRECONDITION for a failed
|
|
240
|
+
* doctor check, which is a different condition - the server is not ready, as
|
|
241
|
+
* opposed to the operator asking for the wrong thing - and this deliberately
|
|
242
|
+
* does not borrow it.
|
|
243
|
+
*/
|
|
244
|
+
export declare class NotInstalledError extends CliError {
|
|
245
|
+
readonly exitCode: ExitCode;
|
|
246
|
+
}
|
|
247
|
+
/** The file exists but this build cannot safely interpret it. */
|
|
248
|
+
export declare class DeployStateError extends CliError {
|
|
249
|
+
readonly exitCode: ExitCode;
|
|
250
|
+
}
|
|
251
|
+
export declare function deployStatePath(deployRoot: string): string;
|
|
252
|
+
/** Returns undefined when nothing is installed; throws when it is unreadable. */
|
|
253
|
+
export declare function readState(deployRoot: string): DeployState | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Brings a parsed state record of ANY version this CLI ever wrote up to
|
|
256
|
+
* `DEPLOY_STATE_VERSION`. Pure: it reads nothing and writes nothing, so a
|
|
257
|
+
* read-only command (`status`) never rewrites the file; the next `writeState`
|
|
258
|
+
* persists the upgraded shape.
|
|
259
|
+
*
|
|
260
|
+
* - v1 -\> v2: adds an empty `history`. `host` and `proxy` stay ABSENT rather
|
|
261
|
+
* than being fabricated -- nothing observed them yet, and the next
|
|
262
|
+
* successful run fills them in.
|
|
263
|
+
* - anything else (a newer appctl, a hand edit) is REFUSED rather than
|
|
264
|
+
* guessed: misreading a state file means updating the wrong checkout or
|
|
265
|
+
* reporting the wrong commit as deployed.
|
|
266
|
+
*/
|
|
267
|
+
export declare function upgradeState(raw: unknown, source?: string): DeployState;
|
|
268
|
+
/**
|
|
269
|
+
* Prepends one successful run to a history, newest first, capped.
|
|
270
|
+
*
|
|
271
|
+
* Pure, and the ONLY way an entry is added, so the cap and the order are
|
|
272
|
+
* enforced in one place. Called only from the success paths of install and
|
|
273
|
+
* update; a failed run never reaches it and so keeps the prior list intact.
|
|
274
|
+
*/
|
|
275
|
+
export declare function appendHistory(history: readonly DeploymentHistoryEntry[] | undefined, entry: DeploymentHistoryEntry, limit?: number): DeploymentHistoryEntry[];
|
|
276
|
+
/** Reads the state, or explains that there is nothing here to act on. */
|
|
277
|
+
export declare function requireState(deployRoot: string): DeployState;
|
|
278
|
+
/**
|
|
279
|
+
* Writes the state atomically, 0600.
|
|
280
|
+
*
|
|
281
|
+
* The temp-file-then-rename dance is copied from `writeConfigFile`, whose long
|
|
282
|
+
* comment explains why: a plain `writeFileSync(path, data, { mode })` applies
|
|
283
|
+
* the mode ONLY when it creates the file, so rewriting an existing one silently
|
|
284
|
+
* keeps whatever permissions it already had. `flag: 'wx'` makes the temp file's
|
|
285
|
+
* creation - and therefore its mode - unambiguous, and the rename is atomic, so
|
|
286
|
+
* an interrupted write cannot leave a half-written state file behind.
|
|
287
|
+
*/
|
|
288
|
+
export declare function writeState(state: DeployState): string;
|
|
289
|
+
//# sourceMappingURL=state.d.ts.map
|