{"id":316401,"date":"2021-01-15T09:00:32","date_gmt":"2021-01-15T09:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316401"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316401","title":{"rendered":"Nuke: \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e .NET-\u043f\u0440\u043e\u0435\u043a\u0442\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c CI\/CD. \u0423 \u0432\u0441\u0435\u0445 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0435\u0431\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442. \u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 Nuke \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 web-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043d\u0430 \u043f\u043e\u043a\u043e\u0439 .NET-Framework \u0441 \u043f\u0440\u0438\u0446\u0435\u043b\u043e\u043c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e .NET 5. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a Fake, \u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443 \u043d\u0430 Nuke.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p>Web-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 C#, \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043b\u0435\u0436\u0438\u0442 .NET-Framework 4.8, Razor Pages + frontend \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 TypeScript, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432 JS-\u0444\u0430\u0439\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/fake.build\/\" rel=\"noopener noreferrer nofollow\">Fake 4<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0441\u0442\u0438\u043d\u0433 \u043d\u0430 AWS (Amazon Web Services)<\/p>\n<\/li>\n<li>\n<p>\u041e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: Production, Staging, Demo<\/p>\n<\/li>\n<\/ul>\n<h4>\u0426\u0435\u043b\u044c<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u0433\u0438\u0431\u043a\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. <br \/>\u042f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 <a href=\"https:\/\/www.nuke.build\" rel=\"noopener noreferrer nofollow\">Nuke<\/a>, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0435 \u0437\u0430 \u0441\u0447\u0451\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Nuke \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438  \u0445\u043e\u0440\u043e\u0448\u043e <a href=\"https:\/\/www.nuke.build\/docs\/getting-started\/setup.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d<\/a>. \u041f\u043b\u044e\u0441\u043e\u043c \u0438\u0434\u0451\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a IDE (\u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 &#8212; Rider). \u042f \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Fake 5 \u0438\u0437-\u0437\u0430 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430, \u0432\u043d\u043e\u0432\u044c \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c. <a href=\"https:\/\/cakebuild.net\/\" rel=\"noopener noreferrer nofollow\">Cake<\/a>, <a href=\"https:\/\/github.com\/psake\/psake\" rel=\"noopener noreferrer nofollow\">Psake<\/a> \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u043b \u0438\u0437-\u0437\u0430 &#171;\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0441\u0442\u0438&#187;.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>Nuke \u0438\u043c\u0435\u0435\u0442 dotnet tool, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f build-\u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0433\u043e.<\/p>\n<pre><code class=\"cs\">$ dotnet tool install Nuke.GlobalTool --global<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<code> nuke :setup<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 wizard \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438  \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/369\/ac0\/191\/369ac01916ddaba497a47700d2505368.png\" width=\"980\" height=\"508\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 _build<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ac8\/9c4\/d91\/ac89c4d91f9d19e2abae93a6d3fbf223.png\" width=\"1062\" height=\"761\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 boot \u043b\u0435\u0436\u0430\u0442 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430.<br \/>\u041a\u043b\u0430\u0441\u0441 Build \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430. \u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f &#8212; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 Target-\u043e\u0432. \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 Logger. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">Logger.Info($\"Starting build for {ApplicationForBuild} using {BuildEnvironment} environment\");<\/code><\/pre>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a \u043f\u043e\u043b\u044e \u043a\u043b\u0430\u0441\u0441\u0430 Build \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 [Parameter]. \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430<\/h3>\n<p>\u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u043e\u0432<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Nuget-\u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<pre><code class=\"cs\">[Parameter(\"Configuration to build - Default is 'Release'\")] readonly Configuration Configuration = Configuration.Release;  [Parameter(Name=\"application\")] readonly string ApplicationForBuild;  [Parameter(Name=\"environment\")] public readonly string BuildEnvironment;<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u043c\u0435\u0442\u043e\u0434 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 OnBuildInitialized, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 NukeBuild \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c On, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u0440\u0442\/\u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438).<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">protected override void OnBuildInitialized() {   ConfigurationProvider = new ConfigurationProvider(ApplicationForBuild, BuildEnvironment, RootDirectory);   string configFilePath = $\".\/appsettings.json\";   if (!File.Exists(configFilePath))   {   throw new FileNotFoundException($\"Configuration file {configFilePath} is not found\");   }    string configFileContent = File.ReadAllText(configFilePath);    if (string.IsNullOrEmpty(configFileContent))   {   throw new ArgumentNullException($\"Config file {configFilePath} content is empty\");   }    \/* \u041d\u0430\u0441\u0442\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 typescript *\/   ToolsConfiguration = JsonConvert.DeserializeObject&lt;ToolsConfiguration&gt;(configFileContent);    if (ToolsConfiguration == null || string.IsNullOrEmpty(ToolsConfiguration.TypeScriptCompilerFolder))   {   throw new ArgumentNullException($\"Typescript compiler path is not defined\");   }    base.OnBuildInitialized(); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public class ApplicationConfig {   public string ApplicationName { get; set; }   public string DeploymentGroup { get; set; }    \/* \u041e\u043f\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config *\/   public Dictionary&lt;string, string&gt; WebConfigReplacingParams { get; set; }    public ApplicationPathsConfig Paths { get; set; } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public class ConfigurationProvider {   readonly string Name;   readonly string DeployEnvironment;   readonly AbsolutePath RootDirectory;   ApplicationConfig CurrentConfig;    public ConfigurationProvider(string name,                                 string deployEnvironment,                                 AbsolutePath rootDirectory)   {     RootDirectory = rootDirectory;     DeployEnvironment = deployEnvironment;     Name = name;   }    public ApplicationConfig GetConfigForApplication()   {     if (CurrentConfig != null) return CurrentConfig;      string configFilePath = $\".\/BuildConfigs\/{Name}\/{DeployEnvironment}.json\";     if (!File.Exists(configFilePath))     {     throw new FileNotFoundException($\"Configuration file {configFilePath} is not found\");     }      string configFileContent = File.ReadAllText(configFilePath);      if (string.IsNullOrEmpty(configFileContent))     {     throw new ArgumentNullException($\"Config file {configFilePath} content is empty\");     }      CurrentConfig = JsonConvert.DeserializeObject&lt;ApplicationConfig&gt;(configFileContent);     CurrentConfig.Paths = new ApplicationPathsConfig(RootDirectory, Name, CurrentConfig.ApplicationName);      return CurrentConfig;   } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Nuget-\u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/h4>\n<p>\u042d\u0442\u0430\u043f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 (Clean) \u044f \u043e\u043f\u0443\u0441\u043a\u0430\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u0435\u043d \u0438 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442: \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443, \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (RootDirectory) \u0438 \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Restore =&gt; _ =&gt; _ \t    .DependsOn(Clean) \t    .Executes(() =&gt; \t    { \t\t    NuGetTasks.NuGetRestore(config =&gt; \t\t    { \t\t\t    config = config \t\t\t\t    .SetProcessToolPath(RootDirectory \/ \".nuget\" \/ \"NuGet.exe\") \t\t\t\t    .SetConfigFile(RootDirectory \/ \".nuget\" \/ \"NuGet.config\") \t\t\t\t    .SetProcessWorkingDirectory(RootDirectory) \t\t\t\t    .SetOutputDirectory(RootDirectory \/ \"packages\");  \t\t\t    return config; \t\t    }); \t    });<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h4>\n<p>\u041a\u043e\u0434 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f  .NET-\u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u0430\u043b\u0435\u0435 TypeScript-\u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 JavaScript-\u043a\u043e\u0434.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Compile =&gt; _ =&gt; _   .DependsOn(Restore)   .Executes(() =&gt;   {   \tAbsolutePath projectFile = ApplicationConfig.Paths.ProjectDirectory.GlobFiles(\"*.csproj\").FirstOrDefault();      if (projectFile == null)     {     \tthrow new ArgumentNullException($\"Cannot found any projects in {ApplicationConfig.Paths.ProjectDirectory}\");     }      MSBuild(config =&gt;     {       config = config       .SetOutDir(ApplicationConfig.Paths.BinDirectory)       .SetConfiguration(Configuration) \/\/\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0438: Debug\/Release       .SetProperty(\"WebProjectOutputDir\", ApplicationConfig.Paths.ApplicationOutputDirectory)       .SetProjectFile(projectFile)       .DisableRestore(); \/\/\u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435, \u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438        return config;     });     \/* \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c tsc \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 *\/     IProcess typeScriptProcess = ProcessTasks.StartProcess(@\"node\",$@\"tsc -p {ApplicationConfig.Paths.ProjectDirectory}\", ToolsConfiguration.TypeScriptCompilerFolder);     if (!typeScriptProcess.WaitForExit())     {     \tLogger.Error(\"Typescript build is failed\");     \tthrow new Exception(\"Typescript build is failed\");     }    \tCopyDirectoryRecursively(ApplicationConfig.Paths.TypeScriptsSourceDirectory, ApplicationConfig.Paths.TypeScriptsOutDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite);   });<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432: \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0451\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config \u043f\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u043c\u0435\u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 json-\u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 CodeDeploy \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b NuGet-\u043f\u0430\u043a\u0435\u0442\u044b <a href=\"https:\/\/aws.amazon.com\/ru\/sdk-for-net\/\" rel=\"noopener noreferrer nofollow\">AWSSDK<\/a>: AWSSDK.Core, AWSSDK.S3, AWSSDK.CodeDeploy. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 AWS CodeDeploy. \u041e\u043d\u0438 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438 \u0441\u043b\u0443\u0436\u0430\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0446\u0435\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Build.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Publish =&gt; _ =&gt; _ \t  .DependsOn(Compile) \t\t.Executes(async () =&gt; \t\t    { \t\t\t    PrepareApplicationForPublishing();           await PublishApplicationToAws(); \t\t    }); void PrepareWebConfig(Dictionary&lt;string, string&gt; replaceParams) {   if (replaceParams?.Any() != true) return;    Logger.Info($\"Setup Web.config for environment {BuildEnvironment}\");    AbsolutePath webConfigPath = ApplicationConfig.Paths.ApplicationOutputDirectory \/ \"Web.config\";   if (!FileExists(webConfigPath))   {   \tLogger.Error($\"{webConfigPath} is not found\");   \tthrow new FileNotFoundException($\"{webConfigPath} is not found\");   }    XmlDocument webConfig = new XmlDocument();   webConfig.Load(webConfigPath);   XmlNode settings = webConfig.SelectSingleNode(\"configuration\/appSettings\");    if (settings == null)   {   \tLogger.Error(\"Node configuration\/appSettings in the config is not found\");   \tthrow new ArgumentNullException(nameof(settings),\"Node configuration\/appSettings in the config is not found\");   }    foreach (var newParam in replaceParams)   {   \tXmlNode nodeForChange = settings.SelectSingleNode($\"add[@key='{newParam.Key}']\");    \t((XmlElement) nodeForChange)?.SetAttribute(\"value\", newParam.Value);   }    webConfig.Save(webConfigPath); }  void PrepareApplicationForPublishing() { \tAbsolutePath specFilePath = ApplicationConfig.Paths.PublishDirectory \/ AppSpecFile; \tAbsolutePath specFileTemplate = ApplicationConfig.Paths.BuildToolsDirectory \/ AppSpecTemplateFile;  \tPrepareWebConfig(ApplicationConfig.WebConfigReplacingParams);  \tDeleteFile(ApplicationConfig.Paths.ApplicationOutputDirectory); \tCopyDirectoryRecursively(ApplicationConfig.Paths.ApplicationOutputDirectory, ApplicationConfig.Paths.PublishDirectory \/ DeployAppDirectory, \tDirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite); \tCopyDirectoryRecursively(ApplicationConfig.Paths.BuildToolsDirectory \/ DeployScriptsDirectory, ApplicationConfig.Paths.TypeScriptsOutDirectory, \tDirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite); \tCopyFile(ApplicationConfig.Paths.BuildToolsDirectory \/ AppSpecTemplateFile, ApplicationConfig.Paths.PublishDirectory \/ AppSpecFile, FileExistsPolicy.Overwrite); \tCopyDirectoryRecursively(ApplicationConfig.Paths.BuildToolsDirectory \/ DeployScriptsDirectory, ApplicationConfig.Paths.PublishDirectory \/ DeployScriptsDirectory, \tDirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite);  \tLogger.Info($\"Creating archive '{ApplicationConfig.Paths.ArchiveFilePath}'\"); \tCompressionTasks.CompressZip(ApplicationConfig.Paths.PublishDirectory, ApplicationConfig.Paths.ArchiveFilePath); }  async Task PublishApplicationToAws() {   string s3bucketName = \"\";   IAwsCredentialsProvider awsCredentialsProvider = new AwsCredentialsProvider(null, null, \"\");   using S3FileManager fileManager = new S3FileManager(awsCredentialsProvider, RegionEndpoint.EUWest1);   using CodeDeployManager codeDeployManager = new CodeDeployManager(awsCredentialsProvider, RegionEndpoint.EUWest1);    Logger.Info($\"AWS S3: upload artifacts to '{s3bucketName}'\");   FileMetadata metadata = await fileManager.UploadZipFileToBucket(ApplicationConfig.Paths.ArchiveFilePath, s3bucketName);    Logger.Info(   $\"AWS CodeDeploy: create deploy for '{ApplicationConfig.ApplicationName}' in group '{ApplicationConfig.DeploymentGroup}' with config '{DeploymentConfig}'\");   CodeDeployResult deployResult =   await codeDeployManager.CreateDeployForRevision(ApplicationConfig.ApplicationName, metadata, ApplicationConfig.DeploymentGroup, DeploymentConfig);    StringBuilder resultBuilder = new StringBuilder(deployResult.Success ? \"started successfully\\n\" : \"not started\\n\");   resultBuilder = ProcessDeloymentResult(deployResult, resultBuilder);    Logger.Info($\"AWS CodeDeploy: deployment has been {resultBuilder}\");    DeleteFile(ApplicationConfig.Paths.ArchiveFilePath);   Directory.Delete(ApplicationConfig.Paths.ApplicationOutputDirectory, true);   string deploymentId = deployResult.DeploymentId;   DateTime startTime = DateTime.UtcNow;   \/* \u041e\u0436\u0438\u0434\u0430\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 *\/   do   {   \tif(DateTime.UtcNow - startTime &gt; TimeSpan.FromMinutes(30)) break;   \tThread.Sleep(3000);   \tdeployResult = await codeDeployManager.GetDeploy(deploymentId);   \tLogger.Info($\"Deployment proceed: {deployResult.DeploymentInfo.Status}\");   }   while (deployResult.DeploymentInfo.Status == DeploymentStatus.InProgress   \t\t\t|| deployResult?.DeploymentInfo.Status == DeploymentStatus.Created   \t\t\t|| deployResult?.DeploymentInfo.Status == DeploymentStatus.Queued);   Logger.Info($\"AWS CodeDeploy: deployment has been done\"); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u044b, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435.  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u0446\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0439 build \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u0440\u0430\u0437\u0431\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 Target-\u044b, \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0434\u043b\u0438\u043d\u0443 \u043a\u043e\u0434\u0430 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u043e\u0432. \u041d\u043e \u0446\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c Nuke .\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/537460\/\"> https:\/\/habr.com\/ru\/post\/537460\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c CI\/CD. \u0423 \u0432\u0441\u0435\u0445 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0435\u0431\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442. \u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 Nuke \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 web-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043d\u0430 \u043f\u043e\u043a\u043e\u0439 .NET-Framework \u0441 \u043f\u0440\u0438\u0446\u0435\u043b\u043e\u043c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e .NET 5. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a Fake, \u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443 \u043d\u0430 Nuke.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p>Web-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 C#, \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043b\u0435\u0436\u0438\u0442 .NET-Framework 4.8, Razor Pages + frontend \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 TypeScript, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432 JS-\u0444\u0430\u0439\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/fake.build\/\" rel=\"noopener noreferrer nofollow\">Fake 4<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0441\u0442\u0438\u043d\u0433 \u043d\u0430 AWS (Amazon Web Services)<\/p>\n<\/li>\n<li>\n<p>\u041e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: Production, Staging, Demo<\/p>\n<\/li>\n<\/ul>\n<h4>\u0426\u0435\u043b\u044c<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u0433\u0438\u0431\u043a\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. <br \/>\u042f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 <a href=\"https:\/\/www.nuke.build\" rel=\"noopener noreferrer nofollow\">Nuke<\/a>, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0435 \u0437\u0430 \u0441\u0447\u0451\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Nuke \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438  \u0445\u043e\u0440\u043e\u0448\u043e <a href=\"https:\/\/www.nuke.build\/docs\/getting-started\/setup.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d<\/a>. \u041f\u043b\u044e\u0441\u043e\u043c \u0438\u0434\u0451\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a IDE (\u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 &#8212; Rider). \u042f \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Fake 5 \u0438\u0437-\u0437\u0430 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430, \u0432\u043d\u043e\u0432\u044c \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c. <a href=\"https:\/\/cakebuild.net\/\" rel=\"noopener noreferrer nofollow\">Cake<\/a>, <a href=\"https:\/\/github.com\/psake\/psake\" rel=\"noopener noreferrer nofollow\">Psake<\/a> \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u043b \u0438\u0437-\u0437\u0430 &#171;\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0441\u0442\u0438&#187;.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>Nuke \u0438\u043c\u0435\u0435\u0442 dotnet tool, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f build-\u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0433\u043e.<\/p>\n<pre><code class=\"cs\">$ dotnet tool install Nuke.GlobalTool --global<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<code> nuke :setup<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 wizard \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438  \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 _build<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 boot \u043b\u0435\u0436\u0430\u0442 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430.<br \/>\u041a\u043b\u0430\u0441\u0441 Build \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430. \u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f &#8212; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 Target-\u043e\u0432. \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 Logger. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">Logger.Info($\"Starting build for {ApplicationForBuild} using {BuildEnvironment} environment\");<\/code><\/pre>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a \u043f\u043e\u043b\u044e \u043a\u043b\u0430\u0441\u0441\u0430 Build \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 [Parameter]. \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430<\/h3>\n<p>\u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u043e\u0432<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Nuget-\u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<pre><code class=\"cs\">[Parameter(\"Configuration to build - Default is 'Release'\")] readonly Configuration Configuration = Configuration.Release;  [Parameter(Name=\"application\")] readonly string ApplicationForBuild;  [Parameter(Name=\"environment\")] public readonly string BuildEnvironment;<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u043c\u0435\u0442\u043e\u0434 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 OnBuildInitialized, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 NukeBuild \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c On, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u0440\u0442\/\u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438).<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">protected override void OnBuildInitialized() {   ConfigurationProvider = new ConfigurationProvider(ApplicationForBuild, BuildEnvironment, RootDirectory);   string configFilePath = $\".\/appsettings.json\";   if (!File.Exists(configFilePath))   {   throw new FileNotFoundException($\"Configuration file {configFilePath} is not found\");   }    string configFileContent = File.ReadAllText(configFilePath);    if (string.IsNullOrEmpty(configFileContent))   {   throw new ArgumentNullException($\"Config file {configFilePath} content is empty\");   }    \/* \u041d\u0430\u0441\u0442\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 typescript *\/   ToolsConfiguration = JsonConvert.DeserializeObject&lt;ToolsConfiguration&gt;(configFileContent);    if (ToolsConfiguration == null || string.IsNullOrEmpty(ToolsConfiguration.TypeScriptCompilerFolder))   {   throw new ArgumentNullException($\"Typescript compiler path is not defined\");   }    base.OnBuildInitialized(); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public class ApplicationConfig {   public string ApplicationName { get; set; }   public string DeploymentGroup { get; set; }    \/* \u041e\u043f\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config *\/   public Dictionary&lt;string, string&gt; WebConfigReplacingParams { get; set; }    public ApplicationPathsConfig Paths { get; set; } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public class ConfigurationProvider {   readonly string Name;   readonly string DeployEnvironment;   readonly AbsolutePath RootDirectory;   ApplicationConfig CurrentConfig;    public ConfigurationProvider(string name,                                 string deployEnvironment,                                 AbsolutePath rootDirectory)   {     RootDirectory = rootDirectory;     DeployEnvironment = deployEnvironment;     Name = name;   }    public ApplicationConfig GetConfigForApplication()   {     if (CurrentConfig != null) return CurrentConfig;      string configFilePath = $\".\/BuildConfigs\/{Name}\/{DeployEnvironment}.json\";     if (!File.Exists(configFilePath))     {     throw new FileNotFoundException($\"Configuration file {configFilePath} is not found\");     }      string configFileContent = File.ReadAllText(configFilePath);      if (string.IsNullOrEmpty(configFileContent))     {     throw new ArgumentNullException($\"Config file {configFilePath} content is empty\");     }      CurrentConfig = JsonConvert.DeserializeObject&lt;ApplicationConfig&gt;(configFileContent);     CurrentConfig.Paths = new ApplicationPathsConfig(RootDirectory, Name, CurrentConfig.ApplicationName);      return CurrentConfig;   } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Nuget-\u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/h4>\n<p>\u042d\u0442\u0430\u043f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 (Clean) \u044f \u043e\u043f\u0443\u0441\u043a\u0430\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u0435\u043d \u0438 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442: \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443, \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (RootDirectory) \u0438 \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Restore =&gt; _ =&gt; _ \t    .DependsOn(Clean) \t    .Executes(() =&gt; \t    { \t\t    NuGetTasks.NuGetRestore(config =&gt; \t\t    { \t\t\t    config = config \t\t\t\t    .SetProcessToolPath(RootDirectory \/ \".nuget\" \/ \"NuGet.exe\") \t\t\t\t    .SetConfigFile(RootDirectory \/ \".nuget\" \/ \"NuGet.config\") \t\t\t\t    .SetProcessWorkingDirectory(RootDirectory) \t\t\t\t    .SetOutputDirectory(RootDirectory \/ \"packages\");  \t\t\t    return config; \t\t    }); \t    });<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h4>\n<p>\u041a\u043e\u0434 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f  .NET-\u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u0430\u043b\u0435\u0435 TypeScript-\u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 JavaScript-\u043a\u043e\u0434.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Compile =&gt; _ =&gt; _   .DependsOn(Restore)   .Executes(() =&gt;   {   \tAbsolutePath projectFile = ApplicationConfig.Paths.ProjectDirectory.GlobFiles(\"*.csproj\").FirstOrDefault();      if (projectFile == null)     {     \tthrow new ArgumentNullException($\"Cannot found any projects in {ApplicationConfig.Paths.ProjectDirectory}\");     }      MSBuild(config =&gt;     {       config = config       .SetOutDir(ApplicationConfig.Paths.BinDirectory)       .SetConfiguration(Configuration) \/\/\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0438: Debug\/Release       .SetProperty(\"WebProjectOutputDir\", ApplicationConfig.Paths.ApplicationOutputDirectory)       .SetProjectFile(projectFile)       .DisableRestore(); \/\/\u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435, \u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438        return config;     });     \/* \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c tsc \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 *\/     IProcess typeScriptProcess = ProcessTasks.StartProcess(@\"node\",$@\"tsc -p {ApplicationConfig.Paths.ProjectDirectory}\", ToolsConfiguration.TypeScriptCompilerFolder);     if (!typeScriptProcess.WaitForExit())     {     \tLogger.Error(\"Typescript build is failed\");     \tthrow new Exception(\"Typescript build is failed\");     }    \tCopyDirectoryRecursively(ApplicationConfig.Paths.TypeScriptsSourceDirectory, ApplicationConfig.Paths.TypeScriptsOutDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite);   });<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432: \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0451\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 Web.config \u043f\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u043c\u0435\u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 json-\u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 CodeDeploy \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b NuGet-\u043f\u0430\u043a\u0435\u0442\u044b <a href=\"https:\/\/aws.amazon.com\/ru\/sdk-for-net\/\" rel=\"noopener noreferrer nofollow\">AWSSDK<\/a>: AWSSDK.Core, AWSSDK.S3, AWSSDK.CodeDeploy. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 AWS CodeDeploy. \u041e\u043d\u0438 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438 \u0441\u043b\u0443\u0436\u0430\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0446\u0435\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Build.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">Target Publish =&gt; _ =&gt; _ \t  .DependsOn(Compile) \t\t.Executes(async () =&gt; \t\t    { \t\t\t    PrepareApplicationForPublishing();           await PublishApplicationToAws(); \t\t    }); void PrepareWebConfig(Dictionary&lt;string, string&gt; replaceParams) {   if (replaceParams?.Any() != true) return;    Logger.Info($\"Setup Web.config for environment {BuildEnvironment}\");    AbsolutePath webConfigPath = ApplicationConfig.Paths.ApplicationOutputDirectory \/ \"Web.config\";   if (!FileExists(webConfigPath))   {   \tLogger.Error($\"{webConfigPath} is not found\");   \tthrow new FileNotFoundException($\"{webConfigPath} is not found\");   }    XmlDocument webConfig = new XmlDocument();   webConfig.Load(webConfigPath);   XmlNode settings = webConfig.SelectSingleNode(\"configuration\/appSettings\");    if (settings == null)   {   \tLogger.Error(\"Node configuration\/appSettings in the config is not found\");   \tthrow new ArgumentNullException(nameof(settings),\"Node configuration\/appSettings in the config is not found\");   }    foreach (var newParam in replaceParams)   {   \tXmlNode nodeForChange = settings.SelectSingleNode($\"add[@key='{newParam.Key}']\");    \t((XmlElement) nodeForChange)?.SetAttribute(\"value\", newParam.Value);   }    webConfig.Save(webConfigPath); }  void PrepareApplicationForPublishing() { \tAbsolutePath specFilePath =<\/code><\/pre>\n<\/div>\n<\/details>\n<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-316401","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316401"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316401\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}