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

56 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 sequential from "./sequential";
interface IParameters {
readonly configuration: string;
readonly isCodeAnalysisUnsupported: 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" });
8 years ago
export default ((params, processor) => sequential({
tasks: [
{
8 years ago
params: {
data: render(msbuildTemplate, params),
filename: "MakePackage.msbuild",
},
8 years ago
type: "writefile",
},
{
8 years ago
params: {
data: render(deployTemplate, params),
filename: "Deploy.bat",
},
8 years ago
type: "writefile",
},
{
8 years ago
params: {
data: render(versionTemplate, params),
filename: "version.aspx",
},
8 years ago
type: "writefile",
},
{
8 years ago
params: {
configuration: params.configuration,
isCodeAnalysisUnsupported: params.isCodeAnalysisUnsupported,
overrideOutputDirectory: processor.context.release,
skipCodeSigning: params.skipCodeSigning,
solution: "MakePackage.msbuild",
target: "Package",
},
8 years ago
type: "dotnetcompile",
},
],
}, processor)) as GenericTask<IParameters>;