UNPKG

3 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright © 2019 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/lib/operations/generate/remoteGitProjectPersister");
19const sdm_1 = require("@atomist/sdm");
20const _ = require("lodash");
21const FileSystemGoalCache_1 = require("../goal/cache/FileSystemGoalCache");
22const DefaultRepoRefResolver_1 = require("../handlers/common/DefaultRepoRefResolver");
23const GitHubCredentialsResolver_1 = require("../handlers/common/GitHubCredentialsResolver");
24const EphemeralLocalArtifactStore_1 = require("../internal/artifact/local/EphemeralLocalArtifactStore");
25const GraphQLPreferenceStore_1 = require("../internal/preferences/GraphQLPreferenceStore");
26const rolarAndDashboardLogFactory_1 = require("../log/rolarAndDashboardLogFactory");
27const path = require("path");
28function defaultSoftwareDeliveryMachineConfiguration(configuration) {
29 const repoRefResolver = new DefaultRepoRefResolver_1.DefaultRepoRefResolver();
30 return {
31 sdm: {
32 artifactStore: new EphemeralLocalArtifactStore_1.EphemeralLocalArtifactStore(),
33 projectLoader: new sdm_1.CachingProjectLoader(),
34 logFactory: rolarAndDashboardLogFactory_1.rolarAndDashboardLogFactory(_.get(configuration, "sdm.rolar.url", "https://rolar.atomist.com"), _.get(configuration, "sdm.dashboard.url", "https://app.atomist.com"), _.get(configuration, "sdm.rolar.bufferSize", 1000), _.get(configuration, "sdm.rolar.flushInterval", 1000), configuration.http.client.factory),
35 credentialsResolver: new GitHubCredentialsResolver_1.GitHubCredentialsResolver(),
36 repoRefResolver,
37 repoFinder: sdm_1.allReposInTeam(repoRefResolver),
38 projectPersister: remoteGitProjectPersister_1.RemoteGitProjectPersister,
39 goalScheduler: [],
40 preferenceStoreFactory: GraphQLPreferenceStore_1.GraphQLPreferenceStoreFactory,
41 parameterPromptFactory: sdm_1.commandRequestParameterPromptFactory,
42 goalCache: new FileSystemGoalCache_1.FileSystemGoalCache(path.join(_.get(configuration, "sdm.cache.path"), "goalcache")),
43 },
44 local: {
45 preferLocalSeeds: true,
46 },
47 };
48}
49exports.defaultSoftwareDeliveryMachineConfiguration = defaultSoftwareDeliveryMachineConfiguration;
50//# sourceMappingURL=defaultSoftwareDeliveryMachineConfiguration.js.map
\No newline at end of file