-
Notifications
You must be signed in to change notification settings - Fork 0
/
copier.yml
212 lines (193 loc) · 4.89 KB
/
copier.yml
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
# Static template data
!include questions/auto_general.yml
---
# Decide whether to ask init-only questions.
# This relies on the templated answers file hardcoding `initialized`.
init_questions:
type: bool
default: "{= initialized is not defined or initialized is false =}"
when: false
flavor_init:
type: str
help: Choose which template flavor to base the project on. Cannot be changed later.
choices:
General: general
Compose: compose
Application: app
when: '{= init_questions =}'
flavor:
type: str
choices:
General: general
Compose: compose
Application: app
when: false
default: '{= flavor_recorded if flavor_recorded is defined else flavor_init =}'
service_name:
type: str
help: >
Name of the managed program.
placeholder: '{= "Git" if flavor == "app" else "Gitea" =}'
validator: >-
{!- if not service_name !}
Service name cannot be empty.
{!- endif !}
service_abbr:
type: str
help: >
A slugified version of `service_name`.
placeholder: gitea
default: '{= service_name | lower | regex_replace("[^a-z0-9]", "-") =}'
validator: >-
{!- if not service_abbr !}
Service abbreviation cannot be empty.
{!- endif !}
abbr_pysafe:
type: str
help: >
A short and pythonic version of `service_name`.
placeholder: gitea
default: '{= service_abbr | lower | regex_replace("\W", "_") =}'
validator: >-
{!- if not abbr_pysafe !}
Cannot be empty.
{!- endif !}
{!- if not (abbr_pysafe | regex_search("^[a-z][a-z0-9_]+$")) !}
Must start with a lowercase letter, followed by lowercase letters/digits or underscores.
{!- endif !}
extmods:
type: str
help: Include custom modules in the formula
default: []
choices:
- auth
- beacon
- cache
- cloud
- engine
- execution
- executor
- fileserver
- grain
- log_handler
- matcher
- metaproxy
- netapi
- output
- pillar
- pkgdb
- pkgfile
- proxy
- queue
- renderer
- returner
- roster
- runner
- sdb
- serializer
- state
- thorium
- token
- top
- util
- wheel
- wrapper
multiselect: true
---
# Computed project meta vars (all)
!include questions/auto_project_meta.yml
---
# Which OS to support (all)
!include questions/base_os_support.yml
---
# Package questions (not `compose` flavor)
!include questions/base_pkg.yml
---
# `general` flavor
!include questions/flavor_general.yml
---
# `compose` flavor
!include questions/flavor_compose.yml
---
# `app` flavor
!include questions/flavor_app.yml
---
# default parameters
lookup:
type: yaml
multiline: true
help: >
An arbitrarily nested mapping/dictionary that describes lookup data that the
user should not have to modify. Examples include package dependencies,
some paths, package names etc.
validator: >-
{!- if lookup is not mapping !}Must be a mapping{!- endif !}
default: '{}'
# Example data:
# foo:
# bar: true
# baz: quux
settings:
type: yaml
multiline: true
help: >
An arbitrarily nested mapping/dictionary that describes global parameters
for the formula. Examples include package version and system configuration
for the managed program.
validator: >-
{!- if settings is not mapping !}Must be a mapping{!- endif !}
default: '{}'
# See jinja_extensions/formula.py::yaml_with_descriptions/myst_with_descriptions
# for possible configuration values.
# Example data:
# foo:
# desc: Settings for the `foo` submodule
# foo:bar:
# desc: Specify bar stuff
# foo:baz:
# desc: Specify baz stuff
settings_descriptions:
type: yaml
multiline: true
default: |
{!- for flattened in settings | flatten_dict(include_intermediates=True) !}
{= flattened =}:
desc: ''
{!- endfor !}
help: >
Description of `settings` values, keys are flattened, values config for doc dump.
---
# Customizable project metadata and docs questions
!include questions/base_project_meta.yml
---
# Default `settings`/`lookup` adjustments per flavor
!include questions/auto_settings.yml
---
# ========================================
# | Migrations between template versions |
# ========================================
# =====================================
# | Copier settings for this template |
# =====================================
# Let's require a recent version
_min_copier_version: "9.3.0"
# The template root is found here
_subdirectory: 'project_{= flavor =}'
_skip_if_exists:
# This file is autogenerated by a pre-commit hook.
- docs/ref/states.rst
_envops:
block_start_string: '{!'
block_end_string: '!}'
variable_start_string: '{='
variable_end_string: '=}'
comment_start_string: '{@'
comment_end_string: '@}'
# We need those extensions as helpers
_jinja_extensions:
- copier_templates_extensions.TemplateExtensionLoader
- jinja_extensions/formula.py:YamlDumper
- jinja_extensions/formula.py:RecursiveData
- jinja2.ext.do
- jinja2.ext.loopcontrols