UNPKG

1.3 kBTypeScriptView Raw
1import { GitProject, HandlerContext } from "@atomist/automation-client";
2import { ExecuteGoal, SdmGoalEvent } from "@atomist/sdm";
3export interface DockerOptions {
4 /**
5 * True if the docker image should be pushed to the registry
6 */
7 push?: boolean;
8 /**
9 * Optional registry to push the docker image too.
10 * Needs to set when push === true
11 */
12 registry?: string;
13 /**
14 * Optional user to use when pushing the docker image.
15 * Needs to set when push === true
16 */
17 user?: string;
18 /**
19 * Optional password to use when pushing the docker image.
20 * Needs to set when push === true
21 */
22 password?: string;
23 dockerfileFinder?: (p: GitProject) => Promise<string>;
24}
25export declare type DockerImageNameCreator = (p: GitProject, sdmGoal: SdmGoalEvent, options: DockerOptions, ctx: HandlerContext) => Promise<{
26 registry: string;
27 name: string;
28 tags: string[];
29}>;
30/**
31 * Execute a Docker build for the project
32 * @param {DockerImageNameCreator} imageNameCreator
33 * @param {DockerOptions} options
34 * @returns {ExecuteGoal}
35 */
36export declare function executeDockerBuild(imageNameCreator: DockerImageNameCreator, options: DockerOptions): ExecuteGoal;
37export declare const DefaultDockerImageNameCreator: DockerImageNameCreator;