parent
e0940342ea
commit
580e183b67
@ -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=" "$(Configuration)" == "" ">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="$(PublishDirectory)" -dest:package="$(PackagesDirectory)\{{package}}"" /> |
||||
|
||||
<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> |
Loading…
Reference in new issue