UNPKG

2.73 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright © 2018 Atomist, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17Object.defineProperty(exports, "__esModule", { value: true });
18const remoteGitProjectPersister_1 = require("@atomist/automation-client/operations/generate/remoteGitProjectPersister");
19const allReposInTeam_1 = require("@atomist/sdm/api-helper/command/transform/allReposInTeam");
20const CachingProjectLoader_1 = require("@atomist/sdm/api-helper/project/CachingProjectLoader");
21const _ = require("lodash");
22const DefaultRepoRefResolver_1 = require("../handlers/common/DefaultRepoRefResolver");
23const GitHubCredentialsResolver_1 = require("../handlers/common/GitHubCredentialsResolver");
24const launchGoalK8_1 = require("../handlers/events/delivery/goals/k8s/launchGoalK8");
25const EphemeralLocalArtifactStore_1 = require("../internal/artifact/local/EphemeralLocalArtifactStore");
26const rolarAndDashboardLogFactory_1 = require("../log/rolarAndDashboardLogFactory");
27function 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}
45exports.defaultSoftwareDeliveryMachineConfiguration = defaultSoftwareDeliveryMachineConfiguration;
46//# sourceMappingURL=defaultSoftwareDeliveryMachineConfiguration.js.map
\No newline at end of file