Implemented dotnetpackwebapp task

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 11 years ago
parent e0940342ea
commit 580e183b67
  1. 40
      BuildServer/lib/tasks/dotnetpackwebapp.js
  2. 2
      BuildServer/lib/tasks/dotnetpackwebapp.template.bat
  3. 51
      BuildServer/lib/tasks/dotnetpackwebapp.template.msbuild
  4. 3
      BuildServer/package.json

@ -0,0 +1,40 @@
"use strict";
var fs = require('fs'),
Mustache = require('mustache');
var sequential = require('./sequential');
var msbuildTemplate = fs.readFileSync(__dirname + "/dotnetpackwebapp.template.msbuild", {encoding: "utf8"});
var deployTemplate = fs.readFileSync(__dirname + "/dotnetpackwebapp.template.bat", {encoding: "utf8"});
module.exports = function (params, processor) {
return sequential({
tasks: [
{
type: "writefile",
params: {
filename: "MakePackage.msbuild",
data: Mustache.render(msbuildTemplate, params)
}
},
{
type: "writefile",
params: {
filename: "Deploy.bat",
data: Mustache.render(deployTemplate, params)
}
},
{
type: "dotnetbuilderwrapper",
params: {
command: "compile",
SolutionPath: processor.context.exported + "/" + "MakePackage.msbuild",
Target: "Package",
OutputDirectory: processor.context.release
}
}
]
}, processor);
};

@ -0,0 +1,2 @@
msdeploy.exe -verb:sync -source:package="{{{package}}}" -dest:iisApp="{{{iisApp}}}"
pause

@ -0,0 +1,51 @@
<Project ToolsVersion="4.0" DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
<PropertyGroup>
<Configuration Condition=" &quot;$(Configuration)&quot; == &quot;&quot; ">Release</Configuration>
<HomeDirectory>$(MSBuildProjectDirectory)</HomeDirectory>
<DeployDirectory>$(HomeDirectory)\Deploy</DeployDirectory>
<PublishDirectory>$(DeployDirectory)\Publish</PublishDirectory>
<PackagesDirectory>$(OutputDirectory)\Packages</PackagesDirectory>
<WebSources>$(HomeDirectory)\Source\Host</WebSources>
</PropertyGroup>
<Target Name="Package">
<RemoveDir Directories="$(PublishDirectory)" />
<MSBuild
Projects="$(HomeDirectory)\{{solution}}"
Properties="Configuration=$(Configuration);DeployOnBuild=true;DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder;_PackageTempDir=$(PublishDirectory)"
/>
<TransformXml
Source="$(WebSources)\NLog.config"
Destination="$(PublishDirectory)\NLog.config"
Transform="$(WebSources)\NLog.$(Configuration).config" />
<CallTarget Targets="RemoveUnwantedFiles" />
<MakeDir Directories="$(PackagesDirectory)" />
<Exec Command="msdeploy.exe -verb:sync -source:iisApp=&quot;$(PublishDirectory)&quot; -dest:package=&quot;$(PackagesDirectory)\{{package}}&quot;" />
<Copy SourceFiles="$(HomeDirectory)\Deploy.bat" DestinationFolder="$(PackagesDirectory)" />
<RemoveDir Directories="$(PublishDirectory)" />
</Target>
<Target Name="RemoveUnwantedFiles">
<ItemGroup>
<Files Include="$(PublishDirectory)\packages.config" />
</ItemGroup>
<Delete Files="@(Files)" />
</Target>
</Project>

@ -13,6 +13,7 @@
"git-node": "~0.1.1",
"request": "~2.27.0",
"glob": "~3.2.7",
"nodemailer": "~0.6.0"
"nodemailer": "~0.6.0",
"mustache": "~0.8.1"
}
}

Loading…
Cancel
Save