@webda/shell
Version:
Deploy a Webda app or configure it
106 lines (105 loc) • 2.97 kB
TypeScript
import { DeployerResources } from "@webda/core";
import { Deployer } from "./deployer.js";
/**
* Command mapping for your preferred containerd client
*/
export interface ContainerClientDefinition {
buildTagFile: string;
buildTagStdin: string;
buildStdin: string;
buildFile: string;
pushTag: string;
}
/**
* Current predefined profiles
*/
export type ClientProfiles = "docker" | "buildah";
/**
* Predefined containerd client commands
*/
export declare const ClientDefinitions: {
[key: string]: ContainerClientDefinition;
};
export interface ContainerResources extends DeployerResources {
tag?: string;
push?: boolean;
Dockerfile?: string;
command?: string;
baseImage?: string;
debugDockerfilePath?: string;
workDirectory?: string;
includeWorkspaces?: boolean;
includeLinkModules?: boolean;
errorFile?: string;
logFile?: string;
excludePackages?: string[];
/**
* Container client profile
*
* @default docker
*/
containerClient?: ClientProfiles | ContainerClientDefinition;
}
/**
* @WebdaDeployer WebdaDeployer/Container
*/
export declare class Container<T extends ContainerResources> extends Deployer<T> {
_copied: boolean;
workspaces: boolean;
private client;
loadDefaults(): Promise<void>;
/**
* Build a Docker image with webda application
*
* @param tag to build
* @param file path of Dockerfile
* @param command webda command to run
*/
buildContainer(tag: any, file: any): Promise<{
status: number;
output: string;
error: string;
}>;
/**
* Replace ${...} arguments within a string
*
* `docker build --tag ${tag} --file ${file}`
* will be replace by
* `docker build --tag mytag:1.2.3` --file /tmp/plop`
*
* @param cmd to be executed after
* @param args map to replace
* @returns
*/
replaceArgs(cmd: string, args: any): string;
/**
* Create Docker image and push
*/
deploy(): Promise<{
tag: string;
}>;
copyPackageToLinkModules(pkg: string, includeModules?: boolean, _subpkg?: string): void;
scanLinkModules(absPath: string, onLinkModule: (src: any, relPath: any) => void): void;
/**
* Return the instruction to add webda-shell in Docker
*
* If within development repository it will copy all local files
* Otherwise just a simple yarn add
*/
getDockerfileWebdaShell(): string;
getDockerfileHeader(): string;
getWorkspacesDockerfile(): string;
/**
* Add the deployment export
* @param localPath
* @param appPath
* @returns
*/
addDeploymentToImage(localPath?: string, appPath?: string): string;
copyPackageFilesTo(pkg: string, dst: string, addFiles?: string[]): string;
addCommandToImage(): string;
/**
* Generate a dynamic Dockerfile with webda application
*/
getDockerfile(): string;
}