@fabrika/provider-zerops 0.2.0 → 0.3.2
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/package.json +18 -5
- package/src/api/client.ts +522 -0
- package/src/api/errors.ts +50 -0
- package/src/api/polling.ts +59 -0
- package/src/api/readers.ts +185 -0
- package/src/api/service-env-response.ts +34 -0
- package/src/api/types.ts +602 -0
- package/src/api.ts +29 -1378
- package/src/authoring.ts +7 -10
- package/src/cli-args.ts +2 -6
- package/src/cli.ts +3 -28
- package/src/collaborators.ts +2 -4
- package/src/compile.ts +3 -1
- package/src/control.ts +203 -450
- package/src/descriptor.ts +179 -0
- package/src/index.ts +23 -127
- package/src/installation/admin-options.ts +100 -0
- package/src/installation/admin.ts +123 -0
- package/src/installation/deploy-options.ts +127 -0
- package/src/installation/deploy.ts +668 -0
- package/src/installation/generated/platform-console-schema.ts +41 -0
- package/src/installation/generated/platform-proxy-manifest.ts +72 -0
- package/src/installation/hosts.ts +117 -0
- package/src/installation/index.ts +390 -0
- package/src/installation/init-options.ts +148 -0
- package/src/installation/init.ts +394 -0
- package/src/installation/install-collaborators.ts +27 -0
- package/src/installation/install-environment.ts +193 -0
- package/src/installation/install-options.ts +156 -0
- package/src/installation/install-project.ts +201 -0
- package/src/installation/install-provisioning.ts +185 -0
- package/src/installation/install.ts +262 -0
- package/src/installation/installation-source.ts +42 -0
- package/src/installation/log.ts +77 -0
- package/src/installation/machine-key.ts +65 -0
- package/src/installation/manifest.ts +95 -0
- package/src/installation/placement-options.ts +33 -0
- package/src/installation/platform-source.ts +106 -0
- package/src/installation/platform-upload.ts +34 -0
- package/src/installation/proxy-manifest.ts +113 -0
- package/src/installation/secrets.ts +79 -0
- package/src/installation/sidecar.ts +125 -0
- package/src/installation/source-options.ts +12 -0
- package/src/installation/templates/README.md +116 -0
- package/src/installation/templates/fabrika.ref +1 -0
- package/src/installation/templates/gitignore +3 -0
- package/src/installation/templates/platform.yml +144 -0
- package/src/installation/topology/artifacts.ts +141 -0
- package/src/installation/topology/index.ts +13 -0
- package/src/installation/topology/installation-schemas.ts +225 -0
- package/src/installation/topology/invariants.ts +86 -0
- package/src/installation/topology/setups.ts +442 -0
- package/src/installation/topology/topology.ts +501 -0
- package/src/installation/topology/validate.ts +26 -0
- package/src/installation/upgrade-options.ts +99 -0
- package/src/installation/upgrade-output.ts +31 -0
- package/src/installation/upgrade.ts +373 -0
- package/src/managed-env.ts +113 -0
- package/src/manifest.ts +194 -344
- package/src/namespace/claims.ts +77 -0
- package/src/namespace/codec.ts +179 -0
- package/src/namespace/constants.ts +30 -0
- package/src/namespace/errors.ts +60 -0
- package/src/namespace/manifest.ts +28 -0
- package/src/namespace/operator.ts +151 -0
- package/src/namespace/provisioning.ts +482 -0
- package/src/namespace/proxy-attempt.ts +220 -0
- package/src/namespace/proxy-source.ts +22 -0
- package/src/namespace/topology.ts +115 -0
- package/src/namespace/types.ts +114 -0
- package/src/namespace.ts +34 -1271
- package/src/plan.ts +21 -23
- package/src/provider.ts +266 -241
- package/src/source/constants.ts +11 -0
- package/src/source/port.ts +49 -0
- package/src/source/types.ts +4 -0
- package/src/source/validation.ts +72 -0
- package/src/source.ts +2 -1220
- package/src/types.ts +8 -7
- package/src/version-attempt.ts +18 -0
- package/src/codec.ts +0 -108
- package/src/namespace-command.ts +0 -209
- package/src/source-connection.ts +0 -344
package/src/plan.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import type { ProviderDeployPlan, ProviderJobSpec } from '@fabrika/provider-contract'
|
|
2
1
|
import { type FabrikaManifest, manifestServiceHostnames } from './manifest'
|
|
3
2
|
import type { ZeropsRuntimeTarget } from './types'
|
|
4
3
|
|
|
5
|
-
export type ZeropsStepKind =
|
|
4
|
+
export type ZeropsStepKind =
|
|
5
|
+
| 'apply-import'
|
|
6
|
+
| 'write-service-env'
|
|
7
|
+
| 'reserve-version'
|
|
8
|
+
| 'upload-source'
|
|
9
|
+
| 'trigger-build'
|
|
10
|
+
| 'await-version'
|
|
11
|
+
| 'reconcile-schema'
|
|
6
12
|
|
|
7
|
-
export interface
|
|
13
|
+
export interface ZeropsStep {
|
|
14
|
+
readonly id: string
|
|
8
15
|
readonly kind: ZeropsStepKind
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface ZeropsPlan extends ProviderDeployPlan {
|
|
12
|
-
readonly steps: readonly ZeropsJobSpec[]
|
|
16
|
+
readonly description: string
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
/** Resolve the one declared service that receives this repository's code. */
|
|
@@ -23,29 +27,23 @@ export const resolveDeployHostname = (manifest: FabrikaManifest): string => {
|
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/** Build the provider-owned deploy order without touching the platform. */
|
|
26
|
-
export const buildZeropsPlan = (
|
|
27
|
-
manifest: FabrikaManifest,
|
|
28
|
-
target: ZeropsRuntimeTarget,
|
|
29
|
-
env: string,
|
|
30
|
-
): ZeropsPlan => {
|
|
30
|
+
export const buildZeropsPlan = (manifest: FabrikaManifest, target: ZeropsRuntimeTarget): readonly ZeropsStep[] => {
|
|
31
31
|
const serviceHostnames = manifestServiceHostnames(manifest)
|
|
32
|
-
const steps:
|
|
33
|
-
let previous: string | undefined
|
|
34
|
-
const add = (spec: Omit<ZeropsJobSpec, 'dependsOn'>): void => {
|
|
35
|
-
steps.push(previous === undefined ? spec : { ...spec, dependsOn: [previous] })
|
|
36
|
-
previous = spec.id
|
|
37
|
-
}
|
|
32
|
+
const steps: ZeropsStep[] = []
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
steps.push({
|
|
40
35
|
id: 'apply-import',
|
|
41
36
|
kind: 'apply-import',
|
|
42
37
|
description: `Apply the Zerops import for ${serviceHostnames.length} service(s): ${serviceHostnames.join(', ')}`,
|
|
43
38
|
})
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
steps.push({ id: 'write-service-env', kind: 'write-service-env', description: 'Write the managed service variables' })
|
|
40
|
+
steps.push({ id: 'reserve-version', kind: 'reserve-version', description: 'Reserve a Zerops app version' })
|
|
41
|
+
steps.push({ id: 'upload-source', kind: 'upload-source', description: 'Upload the resolved repository snapshot' })
|
|
42
|
+
steps.push({ id: 'trigger-build', kind: 'trigger-build', description: 'Trigger the Zerops build+deploy pipeline' })
|
|
43
|
+
steps.push({ id: 'await-version', kind: 'await-version', description: 'Await the Zerops pipeline and relay its build log' })
|
|
46
44
|
if (manifest.app.schema !== undefined && target.propustkaUrl !== undefined) {
|
|
47
|
-
|
|
45
|
+
steps.push({ id: 'reconcile-schema', kind: 'reconcile-schema', description: 'Reconcile authz schema into IAM' })
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
return
|
|
48
|
+
return steps
|
|
51
49
|
}
|