-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathNewDeployment.cs
116 lines (103 loc) · 3.86 KB
/
NewDeployment.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
/// <summary>
/// Describes a new deployment status to create. Deployments are a request for a specific ref(branch,sha,tag) to
/// be deployed.
/// </summary>
/// <remarks>
/// API: https://developer.github.com/v3/repos/deployments/
/// </remarks>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewDeployment
{
/// <summary>
/// Initializes a new instance of the <see cref="NewDeployment"/> class.
/// </summary>
/// <param name="ref">The ref to deploy.</param>
public NewDeployment(string @ref)
{
Ref = @ref;
}
/// <summary>
/// The ref to deploy. This can be a branch, tag, or sha. (REQUIRED)
/// </summary>
public string Ref { get; private set; }
/// <summary>
/// Gets or sets the optional task used to specify a task to execute, e.g. deploy or deploy:migrations.
/// Default: deploy
/// </summary>
/// <value>
/// The task.
/// </value>
public DeployTask Task { get; set; }
/// <summary>
/// Merges the default branch into the requested deployment branch if true;
/// Does nothing if false. (DEFAULT if not specified: True)
/// </summary>
public bool? AutoMerge { get; set; }
/// <summary>
/// Optional array of status contexts verified against commit status checks. If this property is null then
/// all unique contexts will be verified before a deployment is created. To bypass checking entirely, set this
/// to an empty collection. Defaults to all unique contexts (aka null).
/// </summary>
/// <value>
/// The required contexts.
/// </value>
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public Collection<string> RequiredContexts { get; set; }
/// <summary>
/// JSON payload with extra information about the deployment.
/// </summary>
public Dictionary<string, string> Payload { get; set; }
/// <summary>
/// Optional name for the target deployment environment (e.g., production, staging, qa). Default: "production"
/// </summary>
/// <value>
/// The environment.
/// </value>
public string Environment { get; set; }
/// <summary>
/// A short description of the deployment.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Indicates if the environment is specific to a deployment and will no longer exist at some point in the future.
/// (DEFAULT if not specified: False)
/// </summary>
public bool? TransientEnvironment { get; set; }
/// <summary>
/// Indicates if the environment is one with which end users directly interact.
/// (DEFAULT if not specified: True when environment is "production" and False otherwise)
/// </summary>
public bool? ProductionEnvironment { get; set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Description: {0}", Description);
}
}
}
/// <summary>
/// The types of deployments tasks that are available.
/// </summary>
public enum DeployTask
{
/// <summary>
/// Deploy everything (default)
/// </summary>
[Parameter(Value = "deploy")]
Deploy,
/// <summary>
/// Deploy migrations only.
/// </summary>
[Parameter(Value = "deploy:migrations")]
DeployMigrations
}
}