Files
runner/src/Sdk/DTPipelines/Pipelines/JobContainer.cs
David Kale 4e85b8f3b7 Allow registry credentials for job/service containers (#694)
* Log in with container credentials if given

* Stub in registry aware auth for later

* Fix hang if password is empty

* Remove default param to fix build

* PR Feedback. Add some tests and fix parse
2020-09-11 12:28:58 -04:00

92 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace GitHub.DistributedTask.Pipelines
{
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class JobContainer
{
/// <summary>
/// Generated unique alias
/// </summary>
public String Alias { get; } = Guid.NewGuid().ToString("N");
/// <summary>
/// Gets or sets the environment which is provided to the container.
/// </summary>
public IDictionary<String, String> Environment
{
get;
set;
}
/// <summary>
/// Gets or sets the container image name.
/// </summary>
public String Image
{
get;
set;
}
/// <summary>
/// Gets or sets the options used for the container instance.
/// </summary>
public String Options
{
get;
set;
}
/// <summary>
/// Gets or sets the volumes which are mounted into the container.
/// </summary>
public IList<String> Volumes
{
get;
set;
}
/// <summary>
/// Gets or sets the ports which are exposed on the container.
/// </summary>
public IList<String> Ports
{
get;
set;
}
/// <summary>
/// Gets or sets the credentials used for pulling the container iamge.
/// </summary>
public ContainerRegistryCredentials Credentials
{
get;
set;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class ContainerRegistryCredentials
{
/// <summary>
/// Gets or sets the user to authenticate to a registry with
/// </summary>
public String Username
{
get;
set;
}
/// <summary>
/// Gets or sets the password to authenticate to a registry with
/// </summary>
public String Password
{
get;
set;
}
}
}