UNPKG

@atomist/sdm-pack-aspect

Version:

an Atomist SDM Extension Pack for visualizing drift across an organization

58 lines 4.21 kB
"use strict"; /* * Copyright © 2019 Atomist, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const automation_client_1 = require("@atomist/automation-client"); const classificationAspect_1 = require("../compose/classificationAspect"); const StackName = "stack"; exports.StackAspect = classificationAspect_1.classificationAspect({ name: StackName, // Deliberately don't display displayName: undefined, toDisplayableFingerprintName: () => "Technology stack", allowMulti: true, }, { classification: "jvm", reason: "has Maven POM", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("pom.xml"); }) }, { classification: "jvm", reason: "has build.gradle", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("build.gradle"); }) }, { classification: "node", reason: "has package.json", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("package.json"); }) }, { classification: "python", reason: "has requirements.txt", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("requirements.txt"); }) }, { classification: "python", reason: "has Python files in root", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return (yield automation_client_1.projectUtils.countFiles(p, "*.py", () => __awaiter(this, void 0, void 0, function* () { return true; }))) > 0; }), }, { classification: ["aws", "lambda"], reason: "has Lambda template", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("template.yml"); }), }); exports.JavaBuild = classificationAspect_1.classificationAspect({ name: "javaBuild", displayName: "Java build tool", toDisplayableFingerprintName: () => "Java build tool", }, { classification: "maven", reason: "has Maven POM", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("pom.xml"); }) }, { classification: "gradle", reason: "has build.gradle", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("build.gradle"); }) }); exports.CiAspect = classificationAspect_1.classificationAspect({ name: "ci", // Deliberately don't display displayName: undefined, toDisplayableFingerprintName: () => "CI tool", }, { classification: "travis", reason: "has .travis.yml", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile(".travis.yml"); }) }, { classification: "jenkins", reason: "has JenkinsFile", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("Jenkinsfile"); }) }, { classification: "circle", reason: "has .circleci/config.yml", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile(".circleci/config.yml"); }), }, { classification: "concourse", reason: "has pipeline.yml", predicate: (p) => __awaiter(this, void 0, void 0, function* () { return p.hasFile("pipeline.yml"); }) }); //# sourceMappingURL=stackAspect.js.map