From b2968cdca180d9b2fc4d6f9d3537d9ea6201ea5d Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Thu, 7 May 2020 16:17:28 -0700 Subject: [PATCH] Update schema docs (#458) --- docs/reference/schema.md | 41 +++++++++++- src/schema/tye-schema.json | 130 +++++++++++++++++++++++++++++++++++-- 2 files changed, 165 insertions(+), 6 deletions(-) diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 65e081de..a6f8e1fb 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -146,13 +146,21 @@ Including a `project` entry marks the service as a *project*: #### `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*: - It will pulled and run locally using Docker during development. - 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) 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. +## 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` elements appear in a list inside the `bindings` property of a `Service`. diff --git a/src/schema/tye-schema.json b/src/schema/tye-schema.json index 110e0ac6..14266cb8 100644 --- a/src/schema/tye-schema.json +++ b/src/schema/tye-schema.json @@ -29,6 +29,13 @@ "$ref": "#/definitions/ingress" } }, + "extensions": { + "description": "Extensions to be added to tye.", + "type": "array", + "items": { + "$ref": "#/definitions/extension" + } + }, "services": { "description": "The application's services.", "type": "array", @@ -47,6 +54,12 @@ }, { "$ref": "#/definitions/project" + }, + { + "$ref": "#/definitions/repository" + }, + { + "$ref": "#/definitions/include" } ] } @@ -109,6 +122,45 @@ ], "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": { "type": "object", "properties": { @@ -136,7 +188,7 @@ "type": "string" }, "replicas": { - "description": "Number of service replices to create.", + "description": "Number of service replicas to create.", "type": "integer" }, "bindings": { @@ -166,6 +218,40 @@ }, "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": { "type": "object", "properties": { @@ -173,10 +259,25 @@ "description": "The service name. Must be unique per-application.", "type": "string" }, + "volumes": { + "description": "Volumes to mount to the container.", + "type": "array", + "items": { + "$ref": "#/definitions/volume" + } + }, "image": { "description": "The name of a Docker image.", "type": "string" }, + "dockerFile": { + "description": "The Dockerfile to use.", + "type": "string" + }, + "dockerFileContext": { + "description": "The Dockerfile context to run docker build on.", + "type": "string" + }, "env": { "description": "Environment variables to use when launching.", "type": "array", @@ -189,7 +290,7 @@ "type": "string" }, "replicas": { - "description": "Number of service replices to create.", + "description": "Number of service replicas to create.", "type": "integer" }, "bindings": { @@ -201,8 +302,7 @@ } }, "required": [ - "name", - "image" + "name" ] }, "ingress": { @@ -283,6 +383,13 @@ "$ref": "#/definitions/env-var" } }, + "buildProperties": { + "description": "Build properties to use when launching or building a project.", + "type": "array", + "items": { + "$ref": "#/definitions/build-property" + } + }, "args": { "description": "Command-line arguments to use when launching.", "type": "string" @@ -292,7 +399,7 @@ "type": "boolean" }, "replicas": { - "description": "Number of service replices to create.", + "description": "Number of service replicas to create.", "type": "integer" }, "bindings": { @@ -307,6 +414,19 @@ "name", "project" ] + }, + "extension": + { + "type": "object", + "properties": { + "name": { + "description": "Extension name.", + "type": "string" + } + }, + "required": [ + "name" + ] } } } \ No newline at end of file