UNPKG

@topgroup/diginext

Version:

A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.

158 lines 4.99 kB
import type { IUser, IWorkspace } from "../entities"; import type { InputOptions, IQueryFilter, IQueryOptions, IResponsePagination, ResponseData } from "../interfaces"; import { IPostQueryParams } from "../interfaces"; import type { Ownership } from "../interfaces/SystemTypes"; import type { StartBuildParams } from "../modules/build"; import { PromoteDeployEnvironmentOptions } from "../modules/deploy/promote-deploy-environment"; import DeployService from "../services/DeployService"; export type DeployBuildParams = { /** * Deploy environment * @example "dev", "prod" */ env: string; /** * `[OPTIONAL]` - Cluster's slug */ cluster?: string; /** * `[OPTIONAL]` - Container registry's slug */ registry?: string; /** * User ID of the author */ author?: string; /** * [DANGER] * --- * Should delete old deployment and deploy a new one from scratch * @default false */ shouldUseFreshDeploy?: boolean; /** * ### FOR DEPLOY to PROD * Force roll out the release to "prod" deploy environment (instead of "prerelease" environment) * @default false */ forceRollOut?: boolean; /** * ### WARNING * Skip checking deployed POD's ready status. * - The response status will always be SUCCESS even if the pod is unable to start up properly. * @default false */ skipReadyCheck?: boolean; /** * ### WARNING * Skip watching the progress of deployment, let it run in background, won't return the deployment's status. * @default true */ deployInBackground?: boolean; /** * Health check path * @default "/" */ healthzPath?: string | null; }; export default class DeployController { user: IUser; workspace: IWorkspace; ownership: Ownership; service: DeployService; filter: IQueryFilter; options: IQueryOptions; pagination: IResponsePagination; /** * ### [DEPRECATED] * #### Use `buildAndDeploy()` instead. * Build container image first, then deploy that build to target deploy environment. */ deployFromSource(body: { options: InputOptions; }, queryParams?: IPostQueryParams): ResponseData | { status: number; messages: string[]; }; /** * Build container image first, then deploy that build to target deploy environment. * - `Alias of "/api/v1/deploy/from-source"` */ buildAndDeploy(body: { buildParams: StartBuildParams; deployParams: DeployBuildParams; }, queryParams?: IPostQueryParams): Promise<ResponseData>; /** * Build container image first, then deploy that build to target deploy environment. * - `Alias of "/api/v1/deploy/build-first"` */ buildFromSourceAndDeploy(body: { buildParams: StartBuildParams; deployParams: DeployBuildParams; }, queryParams?: IPostQueryParams): Promise<ResponseData>; /** * Build container image from app's git repo and deploy it to target deploy environment. */ buildFromAppAndDeploy(body: { /** * App's slug */ appSlug: string; /** * Target git branch to build and deploy */ gitBranch: string; deployParams: DeployBuildParams; }): Promise<ResponseData>; /** * Build container image from app's git repo and deploy it to target deploy environment. * - Flow: fork the git repo -> build from the new repo -> deploy to Diginext */ buildFromGitRepoAndDeploy(body: { /** * Git repo SSH url */ sshUrl: string; /** * Target git branch to build and deploy */ gitBranch: string; /** * Cluster's slug * - **CAUTION: will take the default or random cluster if not specified**. */ clusterSlug?: string; /** * Exposed port */ port: string; deployParams: DeployBuildParams; }): Promise<ResponseData>; /** * Deploy app to target environment from a "success" build. */ deployFromBuild(body: { /** * Build's slug */ buildSlug: string; } & DeployBuildParams, queryParams?: IPostQueryParams): Promise<ResponseData | { messages: any[]; status: number; data: import("../modules/deploy/deploy-build-v2").DeployBuildV2Result; }>; /** * Deploy app to target environment from a release. */ deployFromRelease(body: { /** * Release's slug */ releaseSlug: string; } & DeployBuildParams, queryParams?: IPostQueryParams): Promise<ResponseData>; /** * Promote a deploy environment to another deploy environment (default: "production"). */ promoteDeployEnvironment(body: PromoteDeployEnvironmentOptions): Promise<ResponseData>; } //# sourceMappingURL=DeployController.d.ts.map