-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate-example.yaml
More file actions
53 lines (51 loc) · 1.57 KB
/
Copy pathtemplate-example.yaml
File metadata and controls
53 lines (51 loc) · 1.57 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
# GitLab CLI 输出模板示例
# 支持 Go template 语法,可以访问 OutputConfig 结构中的所有数据
# 数据结构: .Endpoint (完整 URL), .Scheme (http/https), .Host (主机名) 是 GitLab 服务器配置
# Data: .SSH provides SSH endpoint, host and port when available
# 数据结构: .Users[0] 包含 Username, Email, Name, UserID, Token, Groups
{{- range .Users }}
# ========================================
# 用户: {{ .Username }}
# ========================================
toolchains:
gitlab:
# endpoint is the full endpoint of the server
endpoint: {{ $.Endpoint }}
host: {{ $.Host }}
# scheme, http or https
scheme: {{ $.Scheme }}
{{- if $.SSH }}
ssh:
endpoint: {{ $.SSH.Endpoint }}
host: {{ $.SSH.Host }}
port: {{ $.SSH.Port }}
{{- end }}
# username, the user name of the login account
username: {{ .Username }}
# email
email: {{ .Email }}
{{- if .Token }}
# Personal Access Token
token:
value: {{ .Token.Value }}
scope: {{ range $i, $s := .Token.Scope }}{{ if $i }}, {{ end }}{{ $s }}{{ end }}
expires_at: {{ .Token.ExpiresAt }}
{{- end }}
{{- if .Groups }}
# Groups and Projects
TestGroups:
default: {{ .Username }}
{{- range .Groups }}
- name: {{ .Name }}
path: {{ .Path }}
group_id: {{ .GroupID }}
visibility: {{ .Visibility }}
{{- if .Projects }}
projects:
{{- range .Projects }}
- name: {{ .Name }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}