import Docker from 'dockerode'; import { Listr, ListrTask, ListrOptions } from 'listr2'; import { EnvVars, VersionedConfig } from '@bmd-studio/genstack-environment'; export * from './docker'; export * from './services'; export interface ServiceRepository { url: string; ref?: string; } /** * Definition of a (micro) service. */ export interface Service { /** True when this service is active and should be deployed. */ active?: boolean; /** Name of the service to identity it throughout the application. */ name: string; /** Reference to the container to be used as a base for this service. */ repository?: ServiceRepository; /** The relative path to the project-specific files for this service. */ path?: string; /** Additional environment variables passed to this service. */ env?: EnvVars; } /** * Versioned configuration of all the services for the application */ export interface VersionedServicesConfig extends Omit { /** Required config properties to define services */ config: ServicesConfig; } /** * Definition of what properties are allowed in the `config` namespace of the service configuration. */ export interface ServicesConfig { /** List of all the services */ services: Service[]; } /** * Definition of the possible environment variables for interfacing with the Docker deamon. */ export interface DockerEnv { /** App name prefix to be used by Docker Compose to identity this application. */ COMPOSE_APP_NAME?: string; /** Project name prefix to be used by Docker Compose to identity this application. */ COMPOSE_PROJECT_NAME?: string; /** The host name and port number concatenated with `:` in between of the Docker instance to deploy to. E.g. `docker.bmd:2376` */ DOCKER_HOST?: string; /** Path to the SSL certificate for the Docker instance. */ DOCKER_CERT_PATH?: string; } /** * Definition to match a container to a project service. */ export interface MatchedContainer { /** The container instance */ container: Docker.ContainerInspectInfo; /** The project service definition */ service: Service | undefined; } export interface LaunchConfig { configurations?: LaunchConfiguration[]; compounds?: LaunchCompound[]; } export interface LaunchConfiguration { type: string; request: string; name: string; protocol: string; port: number; restart: boolean; sourceMaps: boolean; localRoot: string; remoteRoot: string; outFiles: string[]; skipFiles: string[]; } export interface LaunchCompound { name: string; configurations: string[]; } export interface TaskRunnerOptions { tasks: ListrTask[]; preTasks?: ListrTask[]; postTasks?: ListrTask[]; taskOptions?: ListrOptions; } export declare type ServiceCommandHandler = (service: Service) => Promise; export declare const createTaskRunner: ({ tasks, preTasks, postTasks, taskOptions }: TaskRunnerOptions) => Listr; /** * The default yargs command builder. * @param argv */ export declare const initializeCommand: () => void;