UNPKG

3.99 kBTypeScriptView Raw
1import { AnyOptions, Configuration } from "@atomist/automation-client/lib/configuration";
2import { RepoFinder } from "@atomist/automation-client/lib/operations/common/repoFinder";
3import { ProjectPersister } from "@atomist/automation-client/lib/operations/generate/generatorUtils";
4import { Maker } from "@atomist/automation-client/lib/util/constructionUtils";
5import { CredentialsResolver } from "../../spi/credentials/CredentialsResolver";
6import { ProgressLogFactory } from "../../spi/log/ProgressLog";
7import { ProjectLoader } from "../../spi/project/ProjectLoader";
8import { RepoRefResolver } from "../../spi/repo-ref/RepoRefResolver";
9import { AddressChannels } from "../context/addressChannels";
10import { ParameterPromptFactory } from "../context/parameterPrompt";
11import { PreferenceStoreFactory } from "../context/preferenceStore";
12import { EnrichGoal } from "../goal/enrichGoal";
13import { GoalScheduler } from "../goal/support/GoalScheduler";
14import { TagGoalSet } from "../goal/tagGoalSet";
15import { RepoTargets } from "./RepoTargets";
16import { EventSigningConfiguration, GoalSigningConfiguration } from "./SigningKeys";
17/**
18 * Infrastructure options common to all SoftwareDeliveryMachines.
19 * Can be used to control the behavior of an SDM, and
20 * also to facilitate testing.
21 */
22export interface SoftwareDeliveryMachineOptions {
23 /**
24 * Object used to load projects
25 */
26 projectLoader?: ProjectLoader;
27 /**
28 * Factory for loggers used to log specific activities
29 * such as build and deployment.
30 */
31 logFactory?: ProgressLogFactory;
32 /**
33 * Strategy for resolving Git repository references
34 */
35 repoRefResolver?: RepoRefResolver;
36 /**
37 * Strategy for finding all repos to act on
38 */
39 repoFinder?: RepoFinder;
40 /**
41 * Strategy for persisting new projects
42 */
43 projectPersister?: ProjectPersister;
44 /**
45 * Strategy for resolving credentials from a handler invocation
46 */
47 credentialsResolver?: CredentialsResolver;
48 /**
49 * Allow customization of editor targeting at per-SDM level.
50 * If set, can still be overridden by individual editor registrations.
51 */
52 targets?: Maker<RepoTargets>;
53 /**
54 * Optional strategy to create a new PreferenceStore implementation
55 */
56 preferenceStoreFactory?: PreferenceStoreFactory;
57 /**
58 * Optional strategy to allow prompting for additional parameters
59 */
60 parameterPromptFactory?: ParameterPromptFactory<any>;
61 /**
62 * Optional strategy for launching goals in different infrastructure
63 */
64 goalScheduler?: GoalScheduler | GoalScheduler[];
65 /**
66 * Optional AddressChannels for communicating with system administrator
67 * Defaults to logging a warning unless this is set.
68 */
69 adminAddressChannels?: AddressChannels;
70 /**
71 * Callback to enrich goal metadata before it gets persisted and planned
72 */
73 enrichGoal?: EnrichGoal;
74 /**
75 * Callback to add tags to created goal sets
76 */
77 tagGoalSet?: TagGoalSet;
78 /**
79 * Optional set of keys to sign and verify goals that are produced and received
80 * by this SDM.
81 */
82 goalSigning?: GoalSigningConfiguration;
83 /**
84 * Optional set o of keys to sign and verify custom events.
85 */
86 eventSigning?: EventSigningConfiguration;
87}
88/**
89 * Configure a directory where files can be cached.
90 * This directory is cleaned on SDM startup; files older than 2 hours are removed.
91 */
92export interface CacheConfiguration {
93 cache?: {
94 enabled?: boolean;
95 /**
96 * Directory defaults to /opt/data
97 */
98 path?: string;
99 };
100}
101/**
102 * Configuration that takes SoftwareDeliveryMachineOptions inside the sdm key.
103 */
104export interface SoftwareDeliveryMachineConfiguration<AdditionalConfiguration = {}> extends Configuration {
105 sdm: SoftwareDeliveryMachineOptions & AdditionalConfiguration & AnyOptions;
106}
107//# sourceMappingURL=SoftwareDeliveryMachineOptions.d.ts.map
\No newline at end of file