1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const remoteGitProjectPersister_1 = require("@atomist/automation-client/operations/generate/remoteGitProjectPersister");
|
19 | const allReposInTeam_1 = require("@atomist/sdm/api-helper/command/transform/allReposInTeam");
|
20 | const CachingProjectLoader_1 = require("@atomist/sdm/api-helper/project/CachingProjectLoader");
|
21 | const _ = require("lodash");
|
22 | const DefaultRepoRefResolver_1 = require("../handlers/common/DefaultRepoRefResolver");
|
23 | const GitHubCredentialsResolver_1 = require("../handlers/common/GitHubCredentialsResolver");
|
24 | const launchGoalK8_1 = require("../handlers/events/delivery/goals/k8s/launchGoalK8");
|
25 | const EphemeralLocalArtifactStore_1 = require("../internal/artifact/local/EphemeralLocalArtifactStore");
|
26 | const rolarAndDashboardLogFactory_1 = require("../log/rolarAndDashboardLogFactory");
|
27 | function defaultSoftwareDeliveryMachineConfiguration(configuration) {
|
28 | const repoRefResolver = new DefaultRepoRefResolver_1.DefaultRepoRefResolver();
|
29 | return {
|
30 | sdm: {
|
31 | artifactStore: new EphemeralLocalArtifactStore_1.EphemeralLocalArtifactStore(),
|
32 | projectLoader: new CachingProjectLoader_1.CachingProjectLoader(),
|
33 | logFactory: rolarAndDashboardLogFactory_1.rolarAndDashboardLogFactory(_.get(configuration, "sdm.rolar.url"), _.get(configuration, "sdm.rolar.bufferSize", 1000), _.get(configuration, "sdm.rolar.flushInterval", 1000)),
|
34 | credentialsResolver: new GitHubCredentialsResolver_1.GitHubCredentialsResolver(),
|
35 | repoRefResolver,
|
36 | repoFinder: allReposInTeam_1.allReposInTeam(repoRefResolver),
|
37 | projectPersister: remoteGitProjectPersister_1.RemoteGitProjectPersister,
|
38 | goalLauncher: process.env.ATOMIST_GOAL_LAUNCHER === "kubernetes" ? launchGoalK8_1.createKubernetesGoalLauncher() : undefined,
|
39 | },
|
40 | local: {
|
41 | preferLocalSeeds: true,
|
42 | },
|
43 | };
|
44 | }
|
45 | exports.defaultSoftwareDeliveryMachineConfiguration = defaultSoftwareDeliveryMachineConfiguration;
|
46 |
|
\ | No newline at end of file |