From f5e405e8972898037842f6ac95414b37e56e1bc6 Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 13 Jan 2015 13:29:40 +0300 Subject: [PATCH] TECHNOLOGY-22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technology / TECHNOLOGY-22 Добавление в сервисы информации об их версии --- BuildServer/lib/tasks/dotnetpackwebapp.js | 8 ++++++++ BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild | 2 ++ .../lib/tasks/dotnetpackwebapp.template.version.aspx | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 BuildServer/lib/tasks/dotnetpackwebapp.template.version.aspx diff --git a/BuildServer/lib/tasks/dotnetpackwebapp.js b/BuildServer/lib/tasks/dotnetpackwebapp.js index fb9d2aa..e5c3279 100644 --- a/BuildServer/lib/tasks/dotnetpackwebapp.js +++ b/BuildServer/lib/tasks/dotnetpackwebapp.js @@ -7,6 +7,7 @@ var sequential = require('./sequential'); var msbuildTemplate = fs.readFileSync(__dirname + "/dotnetpackwebapp.template.msbuild", {encoding: "utf8"}); var deployTemplate = fs.readFileSync(__dirname + "/dotnetpackwebapp.template.bat", {encoding: "utf8"}); +var versionTemplate = fs.readFileSync(__dirname + "/dotnetpackwebapp.template.version.aspx", {encoding: "utf8"}); module.exports = function (params, processor) { @@ -26,6 +27,13 @@ module.exports = function (params, processor) { data: Mustache.render(deployTemplate, params) } }, + { + type: "writefile", + params: { + filename: "version.aspx", + data: Mustache.render(versionTemplate, params) + } + }, { type: "dotnetbuilderwrapper", params: { diff --git a/BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild b/BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild index 1229584..2fa8453 100644 --- a/BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild +++ b/BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild @@ -26,6 +26,8 @@ Destination="$(PublishDirectory)\NLog.config" Transform="$(WebSources)\NLog.$(Configuration).config" /> + + diff --git a/BuildServer/lib/tasks/dotnetpackwebapp.template.version.aspx b/BuildServer/lib/tasks/dotnetpackwebapp.template.version.aspx new file mode 100644 index 0000000..7cd4097 --- /dev/null +++ b/BuildServer/lib/tasks/dotnetpackwebapp.template.version.aspx @@ -0,0 +1,9 @@ +<%@ Page Language="C#" %> +{{#versionTypeName}} +<% var assembly = typeof({{versionTypeName}}).Assembly; %> +<% var attribute = (System.Reflection.AssemblyInformationalVersionAttribute)assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyInformationalVersionAttribute), false).Single(); %> +<%= attribute.InformationalVersion %> +{{/versionTypeName}} +{{^versionTypeName}} +Version information unavailable +{{/versionTypeName}}