-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathflags.go
More file actions
198 lines (195 loc) · 5.26 KB
/
flags.go
File metadata and controls
198 lines (195 loc) · 5.26 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package main
import (
"time"
"github.com/urfave/cli/v3"
)
var globalFlags = []cli.Flag{
&cli.StringFlag{
Name: "remote",
Usage: "git remote url",
Sources: cli.EnvVars("PLUGIN_REMOTE", "CI_REPO_CLONE_URL"),
},
&cli.StringFlag{
Name: "remote-ssh",
Usage: "git clone ssh url",
Sources: cli.EnvVars("PLUGIN_REMOTE_SSH", "CI_REPO_CLONE_SSH_URL"),
},
&cli.StringFlag{
Name: "object-format",
Usage: "specify the object format (hash) to be used on init. if not set it is autodetect by the commit sha.",
Sources: cli.EnvVars("PLUGIN_OBJECT_FORMAT"),
},
&cli.StringFlag{
Name: "path",
Usage: "git clone path",
Sources: cli.EnvVars("PLUGIN_PATH", "CI_WORKSPACE"),
},
&cli.StringFlag{
Name: "sha",
Usage: "git commit sha",
Sources: cli.EnvVars("PLUGIN_SHA", "CI_COMMIT_SHA"),
},
&cli.StringFlag{
Name: "ref",
Usage: "git commit ref",
Sources: cli.EnvVars("PLUGIN_REF"),
},
&cli.StringFlag{
Name: "event",
Value: "push",
Usage: "pipeline event",
Sources: cli.EnvVars("CI_PIPELINE_EVENT"),
},
&cli.StringFlag{
Name: "netrc.machine",
Usage: "netrc machine",
Sources: cli.EnvVars("CI_NETRC_MACHINE"),
},
&cli.StringFlag{
Name: "netrc.username",
Usage: "netrc username",
Sources: cli.EnvVars("CI_NETRC_USERNAME"),
},
&cli.StringFlag{
Name: "netrc.password",
Usage: "netrc password",
Sources: cli.EnvVars("CI_NETRC_PASSWORD"),
},
&cli.IntFlag{
Name: "depth",
Usage: "clone depth",
Sources: cli.EnvVars("PLUGIN_DEPTH"),
},
&cli.IntFlag{
Name: "umask",
Usage: "set umask for cloned files (octal), default is 0",
Sources: cli.EnvVars("PLUGIN_UMASK"),
Value: 0,
},
&cli.BoolFlag{
Name: "recursive",
Usage: "clone submodules",
Sources: cli.EnvVars("PLUGIN_RECURSIVE"),
Value: true,
},
&cli.BoolFlag{
Name: "tags",
Usage: "clone tags, if not explicitly set and event is tag its default is true else false",
Sources: cli.EnvVars("PLUGIN_TAGS"),
},
&cli.BoolFlag{
Name: "skip-verify",
Usage: "skip tls verification",
Sources: cli.EnvVars("PLUGIN_SKIP_VERIFY"),
},
&cli.StringFlag{
Name: "custom-cert",
Usage: "path or url to custom cert",
Sources: cli.EnvVars("PLUGIN_CUSTOM_SSL_PATH", "PLUGIN_CUSTOM_SSL_URL"),
},
&cli.BoolFlag{
Name: "submodule-update-remote",
Usage: "update remote submodules",
Sources: cli.EnvVars("PLUGIN_SUBMODULES_UPDATE_REMOTE", "PLUGIN_SUBMODULE_UPDATE_REMOTE"),
},
&cli.StringFlag{
Name: "submodule-override",
Usage: "json map of submodule overrides",
Sources: cli.EnvVars("PLUGIN_SUBMODULE_OVERRIDE"),
},
&cli.BoolFlag{
Name: "submodule-partial",
Usage: "update submodules via partial clone (depth=1) (default)",
Sources: cli.EnvVars("PLUGIN_SUBMODULES_PARTIAL", "PLUGIN_SUBMODULE_PARTIAL"),
Value: true,
},
&cli.DurationFlag{
Name: "backoff",
Usage: "backoff duration",
Sources: cli.EnvVars("PLUGIN_BACKOFF"),
Value: 5 * time.Second,
},
&cli.IntFlag{
Name: "backoff-attempts",
Usage: "backoff attempts",
Sources: cli.EnvVars("PLUGIN_ATTEMPTS"),
Value: 5,
},
&cli.BoolFlag{
Name: "lfs",
Usage: "whether to retrieve LFS content if available",
Sources: cli.EnvVars("PLUGIN_LFS"),
Value: true,
},
&cli.StringFlag{
Name: "env-file",
Usage: "source env file",
},
&cli.StringFlag{
Name: "branch",
Usage: "Change branch name",
Sources: cli.EnvVars("PLUGIN_BRANCH", "CI_COMMIT_BRANCH", "CI_REPO_DEFAULT_BRANCH"),
},
&cli.BoolFlag{
Name: "partial",
Usage: "Enable/Disable Partial clone",
Sources: cli.EnvVars("PLUGIN_PARTIAL"),
Value: true,
},
&cli.StringFlag{
Name: "home",
Usage: "Change home directory",
Sources: cli.EnvVars("PLUGIN_HOME"),
},
&cli.StringFlag{
Name: "safe-directory",
Usage: "Define/replace safe directories",
Sources: cli.EnvVars("PLUGIN_SAFE_DIRECTORY", "CI_WORKSPACE"),
},
&cli.BoolFlag{
Name: "use-ssh",
Usage: "Using ssh for git clone",
Sources: cli.EnvVars("PLUGIN_USE_SSH"),
Value: false,
},
&cli.StringFlag{
Name: "ssh-key",
Usage: "SSH key file for ssh clone",
Sources: cli.EnvVars("PLUGIN_SSH_KEY"),
},
&cli.StringFlag{
Name: "ssh-key-private",
Usage: "private SSH key to store into ssh-key",
Sources: cli.EnvVars("PLUGIN_SSH_KEY_PRIVATE"),
},
&cli.StringFlag{
Name: "ssh-host-key",
Usage: "SSH host key for verification to prevent mitm attacks",
Sources: cli.EnvVars("PLUGIN_SSH_HOST_KEY"),
},
&cli.BoolFlag{
Name: "merge-pull-request",
Usage: "Merge pull reguest with target branch",
Sources: cli.EnvVars("PLUGIN_MERGE_PULL_REQUEST"),
},
&cli.StringFlag{
Name: "target-branch",
Usage: "Target branch when merging pull request",
Sources: cli.EnvVars("PLUGIN_TARGET_BRANCH", "CI_COMMIT_TARGET_BRANCH"),
},
&cli.BoolFlag{
Name: "fetch-target-branch",
Usage: "Fetch target branch without merging (useful for nx affected)",
Sources: cli.EnvVars("PLUGIN_FETCH_TARGET_BRANCH"),
},
&cli.StringFlag{
Name: "git-user-name",
Usage: "Git username when merging pull request",
Sources: cli.EnvVars("PLUGIN_GIT_USERNAME"),
},
&cli.StringFlag{
Name: "git-user-email",
Usage: "Git user email when merging pull request",
Sources: cli.EnvVars("PLUGIN_GIT_USEREMAIL"),
},
}