forked from woodpecker-ci/plugin-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflags.go
148 lines (145 loc) · 3.56 KB
/
flags.go
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
package main
import (
"time"
"github.com/urfave/cli/v2"
)
var globalFlags = []cli.Flag{
&cli.StringFlag{
Name: "remote",
Usage: "git remote url",
EnvVars: []string{"PLUGIN_REMOTE", "CI_REPO_CLONE_URL"},
},
&cli.StringFlag{
Name: "remote-ssh",
Usage: "git clone ssh url",
EnvVars: []string{"PLUGIN_REMOTE_SSH", "CI_REPO_CLONE_SSH_URL"},
},
&cli.StringFlag{
Name: "path",
Usage: "git clone path",
EnvVars: []string{"PLUGIN_PATH", "CI_WORKSPACE"},
},
&cli.StringFlag{
Name: "sha",
Usage: "git commit sha",
EnvVars: []string{"PLUGIN_SHA", "CI_COMMIT_SHA"},
},
&cli.StringFlag{
Name: "ref",
Value: "refs/heads/master",
Usage: "git commit ref",
EnvVars: []string{"PLUGIN_REF", "CI_COMMIT_REF"},
},
&cli.StringFlag{
Name: "event",
Value: "push",
Usage: "pipeline event",
EnvVars: []string{"CI_PIPELINE_EVENT"},
},
&cli.StringFlag{
Name: "netrc.machine",
Usage: "netrc machine",
EnvVars: []string{"CI_NETRC_MACHINE"},
},
&cli.StringFlag{
Name: "netrc.username",
Usage: "netrc username",
EnvVars: []string{"CI_NETRC_USERNAME"},
},
&cli.StringFlag{
Name: "netrc.password",
Usage: "netrc password",
EnvVars: []string{"CI_NETRC_PASSWORD"},
},
&cli.IntFlag{
Name: "depth",
Usage: "clone depth",
EnvVars: []string{"PLUGIN_DEPTH"},
},
&cli.BoolFlag{
Name: "recursive",
Usage: "clone submodules",
EnvVars: []string{"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",
EnvVars: []string{"PLUGIN_TAGS"},
},
&cli.BoolFlag{
Name: "skip-verify",
Usage: "skip tls verification",
EnvVars: []string{"PLUGIN_SKIP_VERIFY"},
},
&cli.StringFlag{
Name: "custom-cert",
Usage: "path or url to custom cert",
EnvVars: []string{"PLUGIN_CUSTOM_SSL_PATH", "PLUGIN_CUSTOM_SSL_URL"},
},
&cli.BoolFlag{
Name: "submodule-update-remote",
Usage: "update remote submodules",
EnvVars: []string{"PLUGIN_SUBMODULES_UPDATE_REMOTE", "PLUGIN_SUBMODULE_UPDATE_REMOTE"},
},
&cli.GenericFlag{
Name: "submodule-override",
Usage: "json map of submodule overrides",
EnvVars: []string{"PLUGIN_SUBMODULE_OVERRIDE"},
Value: &MapFlag{},
},
&cli.DurationFlag{
Name: "backoff",
Usage: "backoff duration",
EnvVars: []string{"PLUGIN_BACKOFF"},
Value: 5 * time.Second,
},
&cli.IntFlag{
Name: "backoff-attempts",
Usage: "backoff attempts",
EnvVars: []string{"PLUGIN_ATTEMPTS"},
Value: 5,
},
&cli.BoolFlag{
Name: "lfs",
Usage: "whether to retrieve LFS content if available",
EnvVars: []string{"PLUGIN_LFS"},
Value: true,
},
&cli.StringFlag{
Name: "env-file",
Usage: "source env file",
},
&cli.StringFlag{
Name: "branch",
Usage: "Change branch name",
EnvVars: []string{"PLUGIN_BRANCH", "CI_COMMIT_BRANCH", "CI_REPO_DEFAULT_BRANCH"},
},
&cli.BoolFlag{
Name: "partial",
Usage: "Enable/Disable Partial clone",
EnvVars: []string{"PLUGIN_PARTIAL"},
Value: true,
},
&cli.StringFlag{
Name: "home",
Usage: "Change home directory",
EnvVars: []string{"PLUGIN_HOME"},
},
&cli.StringFlag{
Name: "safe-directory",
Usage: "Define/replace safe directories",
EnvVars: []string{"PLUGIN_SAFE_DIRECTORY", "CI_WORKSPACE"},
},
&cli.BoolFlag{
Name: "use-ssh",
Usage: "Using ssh for git clone",
EnvVars: []string{"PLUGIN_USE_SSH"},
Value: false,
},
&cli.StringFlag{
Name: "ssh-key",
Usage: "SSH key for ssh clone",
EnvVars: []string{"PLUGIN_SSH_KEY"},
},
}