UNPKG

2.42 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 EphemeralLocalArtifactStore_1 = require("../internal/artifact/local/EphemeralLocalArtifactStore");
25const rolarAndDashboardLogFactory_1 = require("../log/rolarAndDashboardLogFactory");
26function defaultSoftwareDeliveryMachineOptions(configuration) {
27 const repoRefResolver = new DefaultRepoRefResolver_1.DefaultRepoRefResolver();
28 return {
29 sdm: {
30 artifactStore: new EphemeralLocalArtifactStore_1.EphemeralLocalArtifactStore(),
31 projectLoader: new CachingProjectLoader_1.CachingProjectLoader(),
32 logFactory: rolarAndDashboardLogFactory_1.rolarAndDashboardLogFactory(_.get(configuration, "sdm.rolar.url"), _.get(configuration, "sdm.rolar.bufferSize", 1000), _.get(configuration, "sdm.rolar.flushInterval", 1000)),
33 credentialsResolver: new GitHubCredentialsResolver_1.GitHubCredentialsResolver(),
34 repoRefResolver,
35 repoFinder: allReposInTeam_1.allReposInTeam(repoRefResolver),
36 projectPersister: remoteGitProjectPersister_1.RemoteGitProjectPersister,
37 },
38 };
39}
40exports.defaultSoftwareDeliveryMachineOptions = defaultSoftwareDeliveryMachineOptions;
41//# sourceMappingURL=defaultSoftwareDeliveryMachineOptions.js.map
\No newline at end of file