delete un-used code. (#218)

This commit is contained in:
Tingluo Huang
2019-12-16 17:05:26 -05:00
committed by GitHub
parent c3c66bb14a
commit d0a4a41a63
582 changed files with 155 additions and 66274 deletions

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using GitHub.DistributedTask.WebApi;
using Newtonsoft.Json.Linq;
namespace GitHub.DistributedTask.Pipelines
{
@@ -12,18 +9,8 @@ namespace GitHub.DistributedTask.Pipelines
[EditorBrowsable(EditorBrowsableState.Never)]
public static class PipelineConstants
{
/// <summary>
/// The minimum agent version when performing an advanced checkout. This demand
/// is required when multiple checkout steps are used, when the checkout step
/// is not the first step, or when any repository is checked out other than self
/// or none.
/// </summary>
public static readonly String AdvancedCheckoutMinAgentVersion = "2.137.0";
public static readonly String AgentVersionDemandName = "Runner.Version";
public static readonly String AgentName = "Agent.Name";
/// <summary>
/// The default job cancel timeout in minutes.
/// </summary>
@@ -50,21 +37,11 @@ namespace GitHub.DistributedTask.Pipelines
/// </summary>
public static readonly Int32 MaxNodeNameLength = 100;
/// <summary>
/// The repository alias to use for dont-sync-sources.
/// </summary>
public static readonly String NoneAlias = "none";
/// <summary>
/// Alias for the self repository.
/// </summary>
public static readonly String SelfAlias = "self";
/// <summary>
/// Alias for the repository coming from designer build definition.
/// </summary>
public static readonly String DesignerRepo = "__designer_repo";
/// <summary>
/// Error code during graph validation.
/// </summary>
@@ -90,9 +67,6 @@ namespace GitHub.DistributedTask.Pipelines
/// </summary>
internal const String StartingPointNotFound = nameof(StartingPointNotFound);
internal const String CheckpointNodeInstanceNameClaimKey = "nodeInstanceName";
internal const String CheckpointIdClaimKey = "checkpointId";
public static class CheckoutTaskInputs
{
public static readonly String Repository = "repository";
@@ -120,102 +94,5 @@ namespace GitHub.DistributedTask.Pipelines
public static readonly String Resources = "resources";
public static readonly String All = "all";
}
public static class EnvironmentVariables
{
public static readonly String EnvironmentId = "Environment.Id";
public static readonly String EnvironmentName = "Environment.Name";
public static readonly String EnvironmentResourceId = "Environment.ResourceId";
public static readonly String EnvironmentResourceName = "Environment.ResourceName";
}
public static readonly TaskDefinition CheckoutTask = new TaskDefinition
{
Id = new Guid("6d15af64-176c-496d-b583-fd2ae21d4df4"),
Name = "Checkout",
FriendlyName = "Get sources",
Author = "Microsoft",
RunsOn = { TaskRunsOnConstants.RunsOnAgent },
Version = new TaskVersion("1.0.0"),
Description = "Get sources from a repository. Supports Git, TfsVC, and SVN repositories.",
HelpMarkDown = "[More Information](https://github.com)",
Inputs = {
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.Repository,
Required = true,
InputType = TaskInputType.Repository
},
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.Clean,
Required = false,
DefaultValue = Boolean.TrueString,
InputType = TaskInputType.Boolean
},
// Git
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.Submodules, // True or Recursive
Required = false,
InputType = TaskInputType.String
},
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.Lfs, // Checkout lfs object
Required = false,
DefaultValue = Boolean.FalseString,
InputType = TaskInputType.Boolean
},
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.FetchDepth, // Enable shallow fetch
Required = false,
InputType = TaskInputType.String
},
new TaskInputDefinition()
{
Name = CheckoutTaskInputs.PersistCredentials, // Allow script git
Required = false,
DefaultValue = Boolean.FalseString,
InputType = TaskInputType.Boolean
},
},
Execution =
{
{
"agentPlugin",
JObject.FromObject(new Dictionary<String, String>(){ { "target", "Agent.Plugins.Repository.CheckoutTask, Agent.Plugins"} })
}
},
PostJobExecution =
{
{
"agentPlugin",
JObject.FromObject(new Dictionary<String, String>(){ { "target", "Agent.Plugins.Repository.CleanupTask, Agent.Plugins"} })
}
}
};
public static class ScriptStepInputs
{
public static readonly String Script = "script";
public static readonly String WorkingDirectory = "workingDirectory";
public static readonly String Shell = "shell";
}
public static Boolean IsCheckoutTask(this Step step)
{
if (step is TaskStep task &&
task.Reference.Id == PipelineConstants.CheckoutTask.Id &&
task.Reference.Version == PipelineConstants.CheckoutTask.Version)
{
return true;
}
else
{
return false;
}
}
}
}