Build server prototype (integration with GitHub / NuGet / etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
micro-build-server/BuildServer/lib/tasks/dotnetpackwebapp.ts

57 lines
1.8 KiB

"use strict";
import { readFileSync } from "fs";
import { render } from "mustache";
8 years ago
import { join } from "path";
import { GenericTask } from "../types";
import dotnetcompile from "./dotnetcompile";
import sequential from "./sequential";
import writefile from "./writefile";
interface IParameters {
readonly configuration: string;
readonly isCodeAnalysisUnsupported: boolean;
readonly skipCodeAnalysis: boolean;
readonly skipCodeSigning: boolean;
}
8 years ago
const msbuildTemplate = readFileSync(join(__dirname, "/dotnetpackwebapp.template.msbuild"), { encoding: "utf8" });
const deployTemplate = readFileSync(join(__dirname, "/dotnetpackwebapp.template.bat"), { encoding: "utf8" });
const versionTemplate = readFileSync(join(__dirname, "/dotnetpackwebapp.template.version.aspx"), { encoding: "utf8" });
export default ((params) => (processor) => sequential({
8 years ago
tasks: [
{
name: "writemakepackage",
task: writefile({
8 years ago
data: render(msbuildTemplate, params),
filename: "MakePackage.msbuild",
}),
},
{
name: "writedeploy",
task: writefile({
8 years ago
data: render(deployTemplate, params),
filename: "Deploy.bat",
}),
},
{
name: "writeversion",
task: writefile({
8 years ago
data: render(versionTemplate, params),
filename: "version.aspx",
}),
},
{
name: "compile",
task: dotnetcompile({
...params,
8 years ago
overrideOutputDirectory: processor.context.release,
solution: "MakePackage.msbuild",
target: "Package",
}),
8 years ago
},
],
})(processor)) as GenericTask<IParameters>;