added setupoptions for github

This commit is contained in:
Artur Stolear
2019-11-22 14:54:31 +02:00
parent cfab55b468
commit efb7ef8fa1
14 changed files with 97 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
import "reflect-metadata";
import { IBuildAgent, IGitVersionTool } from "../interfaces";
import { TYPES } from "../types";
import { IBuildAgent, IGitVersionTool } from "../interface";
import { SetupOptions, TYPES } from "../types";
import { ioc } from "./ioc";
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
@@ -10,11 +10,12 @@ const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
export async function run() {
try {
const version = "5.1.2";
const includePrerelease = false;
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
await gitVersionTool.install(version, includePrerelease);
const versionSpec = this.buildAgent.getInput(SetupOptions.versionSpec);
const includePrerelease = this.buildAgent.getBooleanInput(SetupOptions.includePrerelease);
await gitVersionTool.install(versionSpec, includePrerelease);
buildAgent.setSucceeded("GitVersion installed successfully", true);
} catch (error) {