Support --ephemeral flag (#660)

This optional flag will configure the runner to only take one job, and let the service un-configure the runner after that job finishes.
This commit is contained in:
Tingluo Huang
2021-09-13 11:28:09 -04:00
committed by GitHub
parent 1b69c279f5
commit 7ffd9af644
7 changed files with 50 additions and 16 deletions

View File

@@ -24,6 +24,7 @@ namespace GitHub.DistributedTask.WebApi
this.OSDescription = referenceToBeCloned.OSDescription;
this.ProvisioningState = referenceToBeCloned.ProvisioningState;
this.AccessPoint = referenceToBeCloned.AccessPoint;
this.Ephemeral = referenceToBeCloned.Ephemeral;
if (referenceToBeCloned.m_links != null)
{
@@ -81,6 +82,16 @@ namespace GitHub.DistributedTask.WebApi
set;
}
/// <summary>
/// Signifies that this Agent can only run one job and will be removed by the server after that one job finish.
/// </summary>
[DataMember]
public bool? Ephemeral
{
get;
set;
}
/// <summary>
/// Whether or not the agent is online.
/// </summary>