UNPKG

@axway/axway-central-cli

Version:

Manage APIs, services and publish to the Amplify Marketplace

66 lines (63 loc) 2.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.gitLabDAEnvVarTemplate = exports.GitLabAgentValues = void 0; var _types = require("../../../../common/types"); function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * @description Values to provide to the gitLab templates. */ class GitLabAgentValues { constructor() { _defineProperty(this, "token", void 0); _defineProperty(this, "baseURL", void 0); _defineProperty(this, "repositoryID", void 0); _defineProperty(this, "repositoryBranch", void 0); _defineProperty(this, "paths", void 0); _defineProperty(this, "filters", void 0); _defineProperty(this, "daQueueName", void 0); _defineProperty(this, "daVersion", void 0); _defineProperty(this, "centralConfig", void 0); this.token = ''; this.baseURL = ''; this.repositoryID = ''; this.repositoryBranch = ''; this.daQueueName = ''; this.daVersion = ''; this.paths = []; this.filters = []; this.centralConfig = new _types.CentralAgentConfig(); } } exports.GitLabAgentValues = GitLabAgentValues; const gitLabDAEnvVarTemplate = () => { return `# GitLab configs GITLAB_TOKEN={{token}} GITLAB_BASE_URL={{baseURL}} GITLAB_REPOSITORY_ID={{repositoryID}} GITLAB_REPOSITORY_BRANCH={{repositoryBranch}} GITLAB_REPOSITORY_SPEC_PATHS={{paths}} GITLAB_REPOSITORY_SPEC_FILTERS={{filters}} # Amplify Central configs CENTRAL_AGENTNAME={{centralConfig.daAgentName}} CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}} CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}} CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}} CENTRAL_ENVIRONMENT={{centralConfig.environment}} CENTRAL_ORGANIZATIONID={{centralConfig.orgId}} {{#compare . centralConfig.ampcTeamName "" operator="!=" }} CENTRAL_TEAM={{centralConfig.ampcTeamName}} {{/compare}} CENTRAL_REGION={{centralConfig.region}} # Logging configs # Define the logging level: info, debug, error LOG_LEVEL=info # Specify where to send the log: stdout, file, both LOG_OUTPUT=stdout # Define where the log files are written LOG_FILE_PATH=logs `; }; exports.gitLabDAEnvVarTemplate = gitLabDAEnvVarTemplate;