зеркало из https://github.com/Azure/draft.git
…
|
||
---|---|---|
.. | ||
addons/azure/webapp_routing | ||
azurePipelines | ||
deployments | ||
dockerfiles | ||
manifests | ||
workflows | ||
README.md | ||
templates.go |
README.md
TEMPLATE DEFINITION DOCS
Definitions
All templates are defined within the ./template
directory with a cluster of go template files accompanied by a draft.yaml
file.
draft.yaml
The draft.yaml
file contains the metadata needed to define a Template in Draft. The structure of the draft.yaml
is as follows:
templateName
- The name of the templatetype
- The type of templatedescription
- Description of template contents/functionalityversions
- the range/list of version definitions for this templatedefaultVersions
- If no version is passed to a template this will be usedparameters
- a struct containing information on each parameter to the templatename
- the parameter name associated to the gotemplate variabledescription
- description of what the parameter is used fortype
- defines the type of the parameterkind
- defines the kind of parameter, useful for prompting and validation within portal/cli/vscerequired
- defines if the parameter is required for the templatedefault
- struct containing information on specific parameters default valuevalue
- the parameters default valuereferenceVar
- the variable to reference if one is not provided
versions
- the versions this item is used for
For the type
parameters at the template level we currently have 4 definitions:
deployment
- the base k8s deployment + service + namespacedockerfile
- representing a dockerfile for a specific languageworkflow
- representing a GitHub Action, ADO Pipeline, or similarmanifest
- a generic k8s manifest. Think PDB, Ingress, HPA that can be added to an existingdeployment
For the type
parameter at the variable level, this is in line with structured types: int
, float
, string
, bool
, object
.
For the kind
parameter, this will be used for validation and transformation logic on the input. As an example, azureResourceGroup
and azureResourceName
can be validated as defined.
Validation
Within the draft config teamplate tests there is validation logic to make sure all draft.yaml
definitions adhere to:
- Unique
templateName
's - Valid Template
type
's - Valid parameter
type
's - Valid parameter
kind
's