From 934b2ed5a2cdbe64a07173057c65710893efd5d7 Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 7 Apr 2017 12:09:18 +0300 Subject: [PATCH] readme and settings updated --- BuildServer/app.ts.example | 1 + BuildServer/lib/index.ts | 2 +- BuildServer/lib/routes/manual.ts | 2 +- BuildServer/tsconfig.json | 2 +- README.md | 48 +++++++++++++++++++++++++++++++- 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/BuildServer/app.ts.example b/BuildServer/app.ts.example index 2a6efff..ef05f32 100644 --- a/BuildServer/app.ts.example +++ b/BuildServer/app.ts.example @@ -29,6 +29,7 @@ const settings: Settings = { }, eslintBrowserConfig: join(__dirname, "settings-eslint-browser.json"), faviconpath: join(__dirname, "public/images/favicon.png"), + githubSiteRoot: "github.enterprise.host", gitpath: "M:/g", ignoreCodeAnalysisByDefault: true, isCodeAnalysisUnsupported: false, diff --git a/BuildServer/lib/index.ts b/BuildServer/lib/index.ts index a16c52d..4873aaf 100644 --- a/BuildServer/lib/index.ts +++ b/BuildServer/lib/index.ts @@ -48,7 +48,7 @@ const run = (settings: Settings) => { .post(routes.manual.post); app.route("/status/:owner/:reponame/:branch/:rev?").get(routes.status.page); - app.route("/pos-github.payonline.ru/*").get(routes.status.pageFromGithub); + app.route(`/${settings.githubSiteRoot}/*`).get(routes.status.pageFromGithub); app.route("/status.svg").get(routes.status.image); app.route("/release/:owner/:reponame/:branch/:rev").get(routes.release); app.route("/artifact/:owner/:reponame/:branch/:rev/*").get(routes.artifact); diff --git a/BuildServer/lib/routes/manual.ts b/BuildServer/lib/routes/manual.ts index 727c8de..8dc87c5 100644 --- a/BuildServer/lib/routes/manual.ts +++ b/BuildServer/lib/routes/manual.ts @@ -13,7 +13,7 @@ export const post: express.RequestHandler = (req, res) => { const options = { ...req.body, - url: `https://pos-github.payonline.ru/${req.body.owner}/${req.body.reponame}`, + url: `https://${settings.githubSiteRoot}/${req.body.owner}/${req.body.reponame}`, }; build(settings, options, (err: string, result: ReportResult) => { diff --git a/BuildServer/tsconfig.json b/BuildServer/tsconfig.json index 4d78198..54cc9ec 100644 --- a/BuildServer/tsconfig.json +++ b/BuildServer/tsconfig.json @@ -12,7 +12,7 @@ "es7" ], "noEmitOnError": true, - "noImplicitAny": true, + "noImplicitAny": false, "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, diff --git a/README.md b/README.md index 8adc875..71b49d4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,48 @@ -micro-build-server +micro-build-server ================== + + +Разработка +========== + +Установить Node.js v6. + +Запустить `npm install` из папки `BuildServer`. + +Создать `app.ts` на основе `app.ts.example`. + +Для проверки code style / типов использовать `npm test`. + +Установка на сервере +==================== + +Установить Node.js v6. + +Скопировать на сервер собранный проект (содержимое папки `bin\Release`) `DotNetBuilder`. + +Установить в GAC сборки `Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed` (можно взять из релиза 6.0.4 с NuGet), `Microsoft.VisualStudio.Setup.Configuration.Interop, PublicKeyToken=b03f5f7f11d50a3a`. + +Склонировать репозиторий (`git clone`). + +Запустить `npm install` из папки `BuildServer`. + +Создать `app.ts` на основе `app.ts.example` (для использования в IIS надо указать `port: process.env["PORT"]`). +Пути `gitpath`, `releasepath`, `tmpcodepath` должны быть максимально короткими. + +Проверить, что `app.ts` правильный с помощью `npm test`. + +Собрать с помощью `npm build` или `npm run build`. + +Запускать с помощью `npm start` или `node app`. +Для использования в IIS - установить iisnode, создать в iis сайт, указывающий на корневую папку `BuildServer` (в которой лежит `Web.config`). + +Возможно, в зависимости от сценариев использования, также понадобится установить на сервер Microsoft .NET Targeting Pack и Windows SDK нужной версии. + +Обновление сервера +================== + +``` +git pull origin master +npm test +npm run build +```