UNPKG

@atomist/sdm

Version:

Atomist Software Delivery Machine SDK

74 lines 3.06 kB
import { ProjectOperationCredentials } from "@atomist/automation-client/lib/operations/common/ProjectOperationCredentials"; import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId"; import { GitProject } from "@atomist/automation-client/lib/project/git/GitProject"; import { ExecuteGoalResult } from "../../api/goal/ExecuteGoalResult"; import { Goal } from "../../api/goal/Goal"; import { ExecuteGoal } from "../../api/goal/GoalInvocation"; import { FulfillableGoal, FulfillableGoalDetails, ImplementationRegistration } from "../../api/goal/GoalWithFulfillment"; import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent"; import { SoftwareDeliveryMachine } from "../../api/machine/SoftwareDeliveryMachine"; import { PushTest } from "../../api/mapping/PushTest"; import { ProgressLog } from "../../spi/log/ProgressLog"; /** * Arguments passed to a [[ReleaseCreator]]. */ export interface ReleaseCreatorArguments { /** Project credentials. */ credentials: ProjectOperationCredentials; /** SDM event triggering this goal. */ goalEvent: SdmGoalEvent; /** Remote repository reference. */ id: RemoteRepoRef; /** The version to create a release for. */ releaseVersion: string; /** Progress log to write status updates to. */ log: ProgressLog; /** Project to create release for. */ project: GitProject; } /** * A function capable of creating a "release", whatever that means to * you. */ export declare type ReleaseCreator = (args: ReleaseCreatorArguments) => Promise<ExecuteGoalResult>; /** * [[IncrementVersion]] fulfillment options. */ export interface ReleaseRegistration extends Partial<ImplementationRegistration> { /** Function capable of creating a release. */ releaseCreator: ReleaseCreator; } /** * Class that abstracts creating a release for a project. */ export declare class Release extends FulfillableGoal { constructor(detailsOrUniqueName?: FulfillableGoalDetails | string, ...dependsOn: Goal[]); /** * Called by the SDM on initialization. This function calls * `super.register` and adds a startup listener to the SDM. * * The startup listener registers a default, no-op goal fulfillment. */ register(sdm: SoftwareDeliveryMachine): void; /** * Add fulfillment to this goal. */ with(registration: ReleaseRegistration): this; } /** * Return an ExecuteGoal function that creates a release using the * provided releaseCreator function. The function converts the * version associated with the goal set into a release-like semantic * version, see [[releaseLikeVersion]], before passing it to the * release creator function. * * @param releaseCreator Release creator function to use to create the release * @return Execute goal function */ export declare function executeRelease(releaseCreator: ReleaseCreator): ExecuteGoal; /** * Push test detecting if the after commit of the push is related to a * release. */ export declare const IsReleaseCommit: PushTest; //# sourceMappingURL=release.d.ts.map