Browse Source

Update schema docs (#458)

pull/465/head
Justin Kotalik 6 years ago
parent
commit
b2968cdca1
  1. 41
      docs/reference/schema.md
  2. 130
      src/schema/tye-schema.json

41
docs/reference/schema.md

@ -146,13 +146,21 @@ Including a `project` entry marks the service as a *project*:
#### `image` (string) #### `image` (string)
The name and optional tag of an image that can be run using Docker. The name and optional tag of an image that can be run using Docker.
Including `image` marks the service as a *container*: Including `image` marks the service as a *container*:
- It will pulled and run locally using Docker during development. - It will pulled and run locally using Docker during development.
- It will not be deployed during deployment. - It will not be deployed during deployment.
#### `dockerFile` (string)
The Dockerfile to build from. Uses the name of the service as the name of the image. Only supported for `tye run` currently.
#### `dockerFileContext` (string)
Path to the Dockerfile Context to run docker build against. This is only used when `dockerFile` is specified as well.
#### `executable` (string) #### `executable` (string)
The path (or filename) of an executable to launch. The path (or filename) of an executable to launch.
@ -231,6 +239,37 @@ The name of the environment variable.
The value of the environment variable. The value of the environment variable.
## Build Properties
Configuration that can be specified when building a project. These will be passed in as MSBuild properties when building a project. It appears in the list `buildProperties` of a `Service`.
### Build Properties Example
```yaml
name: frontend-backend
services:
- name: backend
project: backend/backend.csproj
buildProperties:
- name: Configuration
value: Debug
- name: frontend
project: frontend/frontend.csproj
buildProperties:
- name: Configuration
value: Release
```
### Build Properties Definition
#### `name` (string) *required*
The name of the build property.
#### `value` (string) *required*
The value of the build property.
## Binding ## Binding
`Binding` elements appear in a list inside the `bindings` property of a `Service`. `Binding` elements appear in a list inside the `bindings` property of a `Service`.

130
src/schema/tye-schema.json

@ -29,6 +29,13 @@
"$ref": "#/definitions/ingress" "$ref": "#/definitions/ingress"
} }
}, },
"extensions": {
"description": "Extensions to be added to tye.",
"type": "array",
"items": {
"$ref": "#/definitions/extension"
}
},
"services": { "services": {
"description": "The application's services.", "description": "The application's services.",
"type": "array", "type": "array",
@ -47,6 +54,12 @@
}, },
{ {
"$ref": "#/definitions/project" "$ref": "#/definitions/project"
},
{
"$ref": "#/definitions/repository"
},
{
"$ref": "#/definitions/include"
} }
] ]
} }
@ -109,6 +122,45 @@
], ],
"additionalProperties": false "additionalProperties": false
}, },
"build-property": {
"type": "object",
"properties": {
"name": {
"description": "Build property name.",
"type": "string"
},
"value": {
"description": "Build property name.",
"type": "string"
}
},
"required": [
"name",
"value"
],
"additionalProperties": false
},
"volume": {
"type": "object",
"properties": {
"name": {
"description": "A named volume.",
"type": "string"
},
"source": {
"description": "The local path.",
"type": "string"
},
"target": {
"description": "The destination path within the container.",
"type": "string"
}
},
"required": [
"target"
],
"additionalProperties": false
},
"executable": { "executable": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -136,7 +188,7 @@
"type": "string" "type": "string"
}, },
"replicas": { "replicas": {
"description": "Number of service replices to create.", "description": "Number of service replicas to create.",
"type": "integer" "type": "integer"
}, },
"bindings": { "bindings": {
@ -166,6 +218,40 @@
}, },
"additionalProperties": false "additionalProperties": false
}, },
"repository": {
"properties": {
"name": {
"description": "The service name. Must be unique per-application.",
"type": "string"
},
"repository":
{
"description": "The repository url which will be cloned.",
"type": "string"
}
},
"required": [
"name",
"repository"
]
},
"include": {
"properties": {
"name": {
"description": "The service name. Must be unique per-application.",
"type": "string"
},
"include":
{
"description": "Path to tye.yaml file which will be used in the application.",
"type": "string"
}
},
"required": [
"name",
"include"
]
},
"image": { "image": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -173,10 +259,25 @@
"description": "The service name. Must be unique per-application.", "description": "The service name. Must be unique per-application.",
"type": "string" "type": "string"
}, },
"volumes": {
"description": "Volumes to mount to the container.",
"type": "array",
"items": {
"$ref": "#/definitions/volume"
}
},
"image": { "image": {
"description": "The name of a Docker image.", "description": "The name of a Docker image.",
"type": "string" "type": "string"
}, },
"dockerFile": {
"description": "The Dockerfile to use.",
"type": "string"
},
"dockerFileContext": {
"description": "The Dockerfile context to run docker build on.",
"type": "string"
},
"env": { "env": {
"description": "Environment variables to use when launching.", "description": "Environment variables to use when launching.",
"type": "array", "type": "array",
@ -189,7 +290,7 @@
"type": "string" "type": "string"
}, },
"replicas": { "replicas": {
"description": "Number of service replices to create.", "description": "Number of service replicas to create.",
"type": "integer" "type": "integer"
}, },
"bindings": { "bindings": {
@ -201,8 +302,7 @@
} }
}, },
"required": [ "required": [
"name", "name"
"image"
] ]
}, },
"ingress": { "ingress": {
@ -283,6 +383,13 @@
"$ref": "#/definitions/env-var" "$ref": "#/definitions/env-var"
} }
}, },
"buildProperties": {
"description": "Build properties to use when launching or building a project.",
"type": "array",
"items": {
"$ref": "#/definitions/build-property"
}
},
"args": { "args": {
"description": "Command-line arguments to use when launching.", "description": "Command-line arguments to use when launching.",
"type": "string" "type": "string"
@ -292,7 +399,7 @@
"type": "boolean" "type": "boolean"
}, },
"replicas": { "replicas": {
"description": "Number of service replices to create.", "description": "Number of service replicas to create.",
"type": "integer" "type": "integer"
}, },
"bindings": { "bindings": {
@ -307,6 +414,19 @@
"name", "name",
"project" "project"
] ]
},
"extension":
{
"type": "object",
"properties": {
"name": {
"description": "Extension name.",
"type": "string"
}
},
"required": [
"name"
]
} }
} }
} }
Loading…
Cancel
Save