UNPKG

1.83 kBTypeScriptView Raw
1import { GoalSetter, MachineConfiguration, SoftwareDeliveryMachine, SoftwareDeliveryMachineConfiguration } from "@atomist/sdm";
2/**
3 * Create a **Software Delivery MachineConfiguration** with default predefined goals.
4 * Combines commands and delivery event handling using _goals_.
5 *
6 * Goals and goal "implementations" can be defined by users.
7 * However, certain well known goals are built into the DefaultSoftwareDeliveryMachine
8 * for convenience, with their own associated listeners.
9 *
10 * Well known goal support is based around a delivery process spanning
11 * common goals of fingerprinting, reacting to fingerprint diffs,
12 * code review, build, deployment, endpoint verification and
13 * promotion to a production environment.
14 *
15 * The most important element of a software delivery machine is setting
16 * zero or more _push rules_ in the constructor.
17 * This is normally done using the internal DSL as follows:
18 *
19 * ```
20 * const sdm = createSoftwareDeliveryMachine(
21 * "MyMachine",
22 * options,
23 * whenPushSatisfies(IsMaven, HasSpringBootApplicationClass, not(MaterialChangeToJavaRepo))
24 * .itMeans("No material change to Java")
25 * .setGoals(NoGoals),
26 * whenPushSatisfies(ToDefaultBranch, IsMaven, HasSpringBootApplicationClass, HasCloudFoundryManifest)
27 * .itMeans("Spring Boot service to deploy")
28 * .setGoals(HttpServiceGoals));
29 * ```
30 *
31 * Uses the builder pattern to allow fluent construction. For example:
32 *
33 * ```
34 * softwareDeliveryMachine
35 * .addPushReaction(async pu => ...)
36 * .addNewIssueListener(async i => ...)
37 * .add...;
38 * ```
39 */
40export declare function createSoftwareDeliveryMachine(config: MachineConfiguration<SoftwareDeliveryMachineConfiguration>, ...goalSetters: Array<GoalSetter | GoalSetter[]>): SoftwareDeliveryMachine<SoftwareDeliveryMachineConfiguration>;