diff --git a/BuildServer/.gitignore b/BuildServer/.gitignore index a720875..1c1c81e 100644 --- a/BuildServer/.gitignore +++ b/BuildServer/.gitignore @@ -18,6 +18,6 @@ data *.crt *.js *.js.map -settings.ts +app.ts iisnode diff --git a/BuildServer/app.ts.example b/BuildServer/app.ts.example new file mode 100644 index 0000000..2a6efff --- /dev/null +++ b/BuildServer/app.ts.example @@ -0,0 +1,56 @@ +"use strict"; + +import * as GitHubApi from "github"; +import { join } from "path"; +import run from "./lib"; +import { Settings } from "./lib/types"; + +const createGithub = () => new GitHubApi({ + debug: false, + headers: { "user-agent": "micro-build-server" }, + host: "github.enterprise.host", + pathPrefix: "/api/v3", + protocol: "https", + timeout: 5000, +}); + +const settings: Settings = { + builderExecutable: "../DotNetBuilder/bin/Debug/MicroBuildServer.DotNetBuilder.exe", + createGithub: (repoOwner) => { + const github = createGithub(); + + github.authenticate({ + password: "password", + type: "basic", + username: "username", + }); + + return github; + }, + eslintBrowserConfig: join(__dirname, "settings-eslint-browser.json"), + faviconpath: join(__dirname, "public/images/favicon.png"), + gitpath: "M:/g", + ignoreCodeAnalysisByDefault: true, + isCodeAnalysisUnsupported: false, + nugetApiKey: "NUGET-API-KEY", + nugetHost: "https://nuget.host/", + port: 3000, + // port: process.env["PORT"], + releasepath: "M:/r", + siteRoot: "https://mbs.host/", + skipCodeSigning: true, + smtp: { + auth: { + pass: "password", + user: "username", + }, + host: "smtp.host", + receiver: "receiver@your.domain", + sender: "sender@your.domain", + }, + staticcontentpath: join(__dirname, "public"), + tmpcodepath: "M:/c", + viewspath: join(__dirname, "views"), +}; + +run(settings); diff --git a/BuildServer/lib/index.ts b/BuildServer/lib/index.ts index bc00cde..fbd7051 100644 --- a/BuildServer/lib/index.ts +++ b/BuildServer/lib/index.ts @@ -15,7 +15,6 @@ import { join } from "path"; import * as serveFavicon from "serve-favicon"; import * as serveStatic from "serve-static"; -import settings from "../settings"; import * as routes from "./routes"; import { setSettings } from "./settings-wrapper"; import { Settings } from "./types"; diff --git a/BuildServer/settings.ts.example b/BuildServer/settings.ts.example deleted file mode 100644 index 55b6396..0000000 --- a/BuildServer/settings.ts.example +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -import GitHubApi = require("github"); - -const createGithub = () => new GitHubApi({ - "debug": false, - "headers": { "user-agent": "micro-build-server (mbs.pos)" }, - "host": "pos-github.payonline.ru", - "pathPrefix": "/api/v3", - "protocol": "https", - "timeout": 5000 -}); - -export default { - "builderExecutable": "../DotNetBuilder/bin/Debug/MicroBuildServer.DotNetBuilder.exe", - "codeSigningKeyFile": null, - "codeSigningPublicKey": null, - "createGithub": (repoOwner) => { - const github = createGithub(); - - github.authenticate({ - "password": "*** OWNER APPLICATION PASSWORD ***", - "type": "basic", - "username": repoOwner - }); - - /* Or, alternatively: - github.authenticate({ - "password": "*** MBS APPLICATION PASSWORD ***", - "type": "basic", - "username": "*** MBS USER ***" - }); - */ - - return github; - }, - "eslintBrowserConfig": "settings-eslint-browser.json", - "gitpath": "M:/g", - "ignoreCodeAnalysisByDefault": true, - "isCodeAnalysisUnsupported": false, - "nugetApiKey": "*** NUGET API KEY ***", - "nugetHost": "https://*** NUGET HOST ***/", - "port": 3000, - "releasepath": "M:/r", - "siteRoot": "https://mbs.your.domain/", - "skipCodeSigning": true, - "smtp": { - "auth": { - "pass": "*** SMTP PASSWORD ***", - "user": "*** SMTP USERNAME ***" - }, - "host": "smtp.host", - "receiver": "receiver@your.domain", - "sender": "sender@your.domain" - }, - "tmpcodepath": "M:/c" -};