UNPKG

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