import { GitProject, HandlerContext } from "@atomist/automation-client"; import { ExecuteGoal, SdmGoalEvent } from "@atomist/sdm"; export interface DockerRegistry { /** * Push Url for this registry */ url: string; /** * Should this registry be displayed with the goal status after a push? Default true. */ display?: boolean; /** * Display Url - ie the url humans can go to * assumes / */ displayUrl?: string; /** * If specified, this will replace the label version details (eg <:version>) * For example, for Dockerhub the correct value would be `/tags`, with a displayUrl set * to https://hub.docker.com/r/; will result in: * https://hub.docker.com/r///tags as the link URL * */ displayBrowsePath?: string; /** * How should urls to this registry be labeled? * ie DockerHub, ECR, etc (friendly name instead of big tag string) * if not supplied, we'll display the tag */ label?: string; username?: string; password?: string; } /** * Options to configure the Docker image build */ export interface DockerOptions { /** * Provide the image tag for the docker image to build */ dockerImageNameCreator?: DockerImageNameCreator; /** * True if the docker image should be pushed to the registry */ push?: boolean; /** * Optional Docker config in json as alternative to running * 'docker login' with provided registry, user and password. */ config?: string; /** * Optional registries to push the docker image too. * Needs to set when push === true */ registries?: DockerRegistry[]; /** * Find the Dockerfile within the project * @param p the project */ dockerfileFinder?: (p: GitProject) => Promise; /** * Optionally specify what docker image builder to use. * Defaults to "docker" */ builder?: "docker" | "kaniko"; /** * Optional arguments passed to the docker image builder */ builderArgs?: string[]; } export declare type DockerImageNameCreator = (p: GitProject, sdmGoal: SdmGoalEvent, options: DockerOptions, ctx: HandlerContext) => Promise<{ name: string; tags: string[]; }>; /** * Execute a Docker build for the project * @param {DockerOptions} options * @returns {ExecuteGoal} */ export declare function executeDockerBuild(options: DockerOptions): ExecuteGoal; export declare const DefaultDockerImageNameCreator: DockerImageNameCreator;