|
1 | 1 | package schema |
2 | 2 |
|
3 | | -#TagStrategy: string |
4 | | -#enumTagStrategy: #TagStrategyGitCommit |
5 | | -#TagStrategyGitCommit: #TagStrategy & { |
6 | | - "commit" |
7 | | -} |
8 | | - |
9 | | -// Blueprint contains the schema for blueprint files. |
10 | | -#Blueprint: { |
11 | | - // Version defines the version of the blueprint schema being used. |
12 | | - version: =~"^\\d+\\.\\d+" @go(Version) |
13 | | - |
14 | | - // Global contains the global configuration for the blueprint. |
15 | | - // +optional |
16 | | - global?: #Global @go(Global) |
17 | | - |
18 | | - // Project contains the configuration for the project. |
19 | | - // +optional |
20 | | - project?: #Project @go(Project) |
21 | | -} |
22 | | - |
23 | | -// Deployment contains the configuration for the deployment of the project. |
24 | | -#Deployment: { |
25 | | - // Environment contains the environment to deploy the module to. |
26 | | - environment: (_ | *"dev") & { |
27 | | - string |
28 | | - } @go(Environment) |
29 | | - |
30 | | - // Modules contains the configuration for the deployment modules for the project. |
31 | | - // +optional |
32 | | - modules?: null | #DeploymentModules @go(Modules,*DeploymentModules) |
33 | | -} |
34 | | - |
35 | | -// Deployment contains the configuration for the deployment of the project. |
36 | | -#DeploymentModules: { |
37 | | - // Main contains the configuration for the main deployment module. |
38 | | - main: #Module @go(Main) |
39 | | - |
40 | | - // Support contains the configuration for the support deployment modules. |
41 | | - // +optional |
42 | | - support?: { |
43 | | - [string]: #Module |
44 | | - } @go(Support,map[string]Module) |
45 | | -} |
46 | | - |
47 | | -// Module contains the configuration for a deployment module. |
48 | | -#Module: { |
49 | | - // Container contains the name of the container holding the deployment code. |
50 | | - // Defaults to <module_name>-deployment). For the main module, <module_name> is the project name. |
51 | | - // +optional |
52 | | - container?: null | string @go(Container,*string) |
53 | | - |
54 | | - // Namespace contains the namespace to deploy the module to. |
55 | | - namespace: (_ | *"default") & { |
56 | | - string |
57 | | - } @go(Namespace) |
58 | | - |
59 | | - // Values contains the values to pass to the deployment module. |
60 | | - values: _ @go(Values,any) |
61 | | - |
62 | | - // Version contains the version of the deployment module. |
63 | | - version: string @go(Version) |
64 | | -} |
65 | | - |
66 | 3 | // Global contains the global configuration for the blueprint. |
67 | 4 | #Global: { |
68 | 5 | // CI contains the configuration for the CI system. |
@@ -117,32 +54,6 @@ package schema |
117 | 54 | url: string @go(Url) |
118 | 55 | } |
119 | 56 |
|
120 | | -// Project contains the configuration for the project. |
121 | | -#Project: { |
122 | | - // Name contains the name of the project. |
123 | | - name: =~"^[a-z][a-z0-9_-]*$" @go(Name) |
124 | | - |
125 | | - // Container is the name that the container will be built as. |
126 | | - container: (_ | *name) & { |
127 | | - string |
128 | | - } @go(Container) |
129 | | - |
130 | | - // CI contains the configuration for the CI system. |
131 | | - // +optional |
132 | | - ci?: #ProjectCI @go(CI) |
133 | | - |
134 | | - // Deployment contains the configuration for the deployment of the project. |
135 | | - // +optional |
136 | | - deployment?: #Deployment @go(Deployment) |
137 | | -} |
138 | | -#ProjectCI: { |
139 | | - // Targets configures the individual targets that are run by the CI system. |
140 | | - // +optional |
141 | | - targets?: { |
142 | | - [string]: #Target |
143 | | - } @go(Targets,map[string]Target) |
144 | | -} |
145 | | - |
146 | 57 | // Providers contains the configuration for the providers being used by the CI system. |
147 | 58 | #Providers: { |
148 | 59 | // AWS contains the configuration for the AWS provider. |
@@ -210,43 +121,95 @@ package schema |
210 | 121 | // +optional |
211 | 122 | credentials?: null | #Secret @go(Credentials,*Secret) |
212 | 123 | } |
| 124 | +#TagStrategy: string |
| 125 | +#enumTagStrategy: #TagStrategyGitCommit |
| 126 | +#TagStrategyGitCommit: #TagStrategy & { |
| 127 | + "commit" |
| 128 | +} |
213 | 129 |
|
214 | | -// ProviderGithub contains the configuration for the Github provider. |
215 | | -#ProviderGithub: { |
216 | | - // Credentials contains the credentials to use for Github |
217 | | - // +optional |
218 | | - credentials?: #Secret @go(Credentials) |
| 130 | +// Blueprint contains the schema for blueprint files. |
| 131 | +#Blueprint: { |
| 132 | + // Version defines the version of the blueprint schema being used. |
| 133 | + version: =~"^\\d+\\.\\d+" @go(Version) |
219 | 134 |
|
220 | | - // Registry contains the Github registry to use. |
| 135 | + // Global contains the global configuration for the blueprint. |
221 | 136 | // +optional |
222 | | - registry?: null | string @go(Registry,*string) |
| 137 | + global?: #Global @go(Global) |
| 138 | + |
| 139 | + // Project contains the configuration for the project. |
| 140 | + // +optional |
| 141 | + project?: #Project @go(Project) |
223 | 142 | } |
224 | 143 |
|
225 | | -// Secret contains the secret provider and a list of mappings |
226 | | -#Secret: { |
227 | | - // Maps contains mappings for Earthly secret names to JSON keys in the secret. |
228 | | - // Mutually exclusive with Name. |
| 144 | +// Deployment contains the configuration for the deployment of the project. |
| 145 | +#Deployment: { |
| 146 | + // Environment contains the environment to deploy the module to. |
| 147 | + environment: (_ | *"dev") & { |
| 148 | + string |
| 149 | + } @go(Environment) |
| 150 | + |
| 151 | + // Modules contains the configuration for the deployment modules for the project. |
229 | 152 | // +optional |
230 | | - maps?: { |
231 | | - [string]: string |
232 | | - } @go(Maps,map[string]string) |
| 153 | + modules?: null | #DeploymentModules @go(Modules,*DeploymentModules) |
| 154 | +} |
233 | 155 |
|
234 | | - // Name contains the name of the Earthly secret to use. |
235 | | - // Mutually exclusive with Maps. |
| 156 | +// Deployment contains the configuration for the deployment of the project. |
| 157 | +#DeploymentModules: { |
| 158 | + // Main contains the configuration for the main deployment module. |
| 159 | + main: #Module @go(Main) |
| 160 | + |
| 161 | + // Support contains the configuration for the support deployment modules. |
236 | 162 | // +optional |
237 | | - name?: null | string @go(Name,*string) |
| 163 | + support?: { |
| 164 | + [string]: #Module |
| 165 | + } @go(Support,map[string]Module) |
| 166 | +} |
| 167 | +version: "1.0" |
238 | 168 |
|
239 | | - // Optional determines if the secret is optional. |
| 169 | +// Module contains the configuration for a deployment module. |
| 170 | +#Module: { |
| 171 | + // Container contains the name of the container holding the deployment code. |
| 172 | + // Defaults to <module_name>-deployment). For the main module, <module_name> is the project name. |
240 | 173 | // +optional |
241 | | - optional?: null | bool @go(Optional,*bool) |
| 174 | + container?: null | string @go(Container,*string) |
242 | 175 |
|
243 | | - // Path contains the path to the secret. |
244 | | - path: string @go(Path) |
| 176 | + // Namespace contains the namespace to deploy the module to. |
| 177 | + namespace: (_ | *"default") & { |
| 178 | + string |
| 179 | + } @go(Namespace) |
245 | 180 |
|
246 | | - // Provider contains the provider to use for the secret. |
247 | | - provider: string @go(Provider) |
| 181 | + // Values contains the values to pass to the deployment module. |
| 182 | + values: _ @go(Values,any) |
| 183 | + |
| 184 | + // Version contains the version of the deployment module. |
| 185 | + version: string @go(Version) |
| 186 | +} |
| 187 | + |
| 188 | +// Project contains the configuration for the project. |
| 189 | +#Project: { |
| 190 | + // Name contains the name of the project. |
| 191 | + name: =~"^[a-z][a-z0-9_-]*$" @go(Name) |
| 192 | + |
| 193 | + // Container is the name that the container will be built as. |
| 194 | + container: (_ | *name) & { |
| 195 | + string |
| 196 | + } @go(Container) |
| 197 | + |
| 198 | + // CI contains the configuration for the CI system. |
| 199 | + // +optional |
| 200 | + ci?: #ProjectCI @go(CI) |
| 201 | + |
| 202 | + // Deployment contains the configuration for the deployment of the project. |
| 203 | + // +optional |
| 204 | + deployment?: #Deployment @go(Deployment) |
| 205 | +} |
| 206 | +#ProjectCI: { |
| 207 | + // Targets configures the individual targets that are run by the CI system. |
| 208 | + // +optional |
| 209 | + targets?: { |
| 210 | + [string]: #Target |
| 211 | + } @go(Targets,map[string]Target) |
248 | 212 | } |
249 | | -version: "1.0" |
250 | 213 | #Tagging: { |
251 | 214 | // Aliases contains the aliases to use for git tags. |
252 | 215 | // +optional |
@@ -284,3 +247,39 @@ version: "1.0" |
284 | 247 | // +optional |
285 | 248 | secrets?: [...#Secret] @go(Secrets,[]Secret) |
286 | 249 | } |
| 250 | + |
| 251 | +// ProviderGithub contains the configuration for the Github provider. |
| 252 | +#ProviderGithub: { |
| 253 | + // Credentials contains the credentials to use for Github |
| 254 | + // +optional |
| 255 | + credentials?: #Secret @go(Credentials) |
| 256 | + |
| 257 | + // Registry contains the Github registry to use. |
| 258 | + // +optional |
| 259 | + registry?: null | string @go(Registry,*string) |
| 260 | +} |
| 261 | + |
| 262 | +// Secret contains the secret provider and a list of mappings |
| 263 | +#Secret: { |
| 264 | + // Maps contains mappings for Earthly secret names to JSON keys in the secret. |
| 265 | + // Mutually exclusive with Name. |
| 266 | + // +optional |
| 267 | + maps?: { |
| 268 | + [string]: string |
| 269 | + } @go(Maps,map[string]string) |
| 270 | + |
| 271 | + // Name contains the name of the Earthly secret to use. |
| 272 | + // Mutually exclusive with Maps. |
| 273 | + // +optional |
| 274 | + name?: null | string @go(Name,*string) |
| 275 | + |
| 276 | + // Optional determines if the secret is optional. |
| 277 | + // +optional |
| 278 | + optional?: null | bool @go(Optional,*bool) |
| 279 | + |
| 280 | + // Path contains the path to the secret. |
| 281 | + path: string @go(Path) |
| 282 | + |
| 283 | + // Provider contains the provider to use for the secret. |
| 284 | + provider: string @go(Provider) |
| 285 | +} |
0 commit comments