Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspire schema fixes. #4067

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 120 additions & 2 deletions src/schemas/json/aspire-8.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"oneOf": [
{
"type": "object",
"description": "A resource that represents a Dockerfile that will be built into a container duing deployment.",
"description": "A resource that represents a Dockerfile that will be built into a container during deployment.",
"required": ["type", "path", "context"],
"properties": {
"type": {
Expand All @@ -38,6 +38,9 @@
},
"bindings": {
"$ref": "#/definitions/bindings"
},
"buildArgs": {
"$ref": "#/definitions/buildArgs"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -73,6 +76,54 @@
"bindMounts": {
"$ref": "#/definitions/bindMounts"
},
"volumes": {
"$ref": "#/definitions/volumes"
},
"build": false
},
"additionalProperties": false
},
{
"type": "object",
"description": "A generic container resource.",
"oneOf": [
{
"required": ["type", "build"]
},
{
"required": ["type", "image"]
}
],
"properties": {
"type": {
"const": "container.v1"
},
"image": {
"type": "string",
"description": "A string representing the container image to be used."
},
"entrypoint": {
"type": "string",
"description": "The entrypoint to use for the container image when executed."
},
"args": {
"$ref": "#/definitions/args"
},
"build": {
"$ref": "#/definitions/build"
},
"connectionString": {
"$ref": "#/definitions/connectionString"
},
"env": {
"$ref": "#/definitions/env"
},
"bindings": {
"$ref": "#/definitions/bindings"
},
"bindMounts": {
"$ref": "#/definitions/bindMounts"
},
"volumes": {
"$ref": "#/definitions/volumes"
}
Expand Down Expand Up @@ -113,7 +164,7 @@
},
"workingDirectory": {
"type": "string",
"description": "The path to the working directory. Should be intepretted as being relative to the AppHost directory."
"description": "The path to the working directory. Should be interpreted as being relative to the AppHost directory."
},
"command": {
"type": "string",
Expand Down Expand Up @@ -377,6 +428,7 @@
"enum": [
"parameter.v0",
"container.v0",
"container.v1",
"dockerfile.v0",
"project.v0",
"value.v0",
Expand Down Expand Up @@ -416,6 +468,72 @@
"type": "string"
}
},
"build": {
"type": "object",
"description": "An object that captures properties that control the building of a container image.",
"required": ["context", "dockerfile"],
"properties": {
"context": {
"type": "string",
"description": "The path to the context directory for the container build. Can be relative of absolute. If relative it is relative to the location of the manifest file."
},
"dockerfile": {
"type": "string",
"description": "The path to the Dockerfile. Can be relative or absolute. If relative it is relative to the manifest file."
},
"args": {
"type": "object",
"description": "A list of build arguments which are used during container build.",
"additionalProperties": {
"type": "string"
}
},
"secrets": {
"type": "object",
"description": "A list of build arguments which are used during container build.",
"additionalProperties": {
"type": "object",
"required": ["type"],
"oneOf": [
{
"required": ["type", "value"],
"properties": {
"type": {
"type": "string",
"const": "env"
},
"value": {
"type": "string",
"description": "If provided use as the value for the environment variable when docker build is run."
}
}
},
{
"required": ["type", "source"],
"properties": {
"type": {
"type": "string",
"const": "file"
},
"source": {
"type": "string",
"description": "Path to secret file. If relative, the path is relative to the manifest file."
}
}
}
]
}
}
},
"additionalProperties": false
},
"buildArgs": {
"type": "object",
"description": "A list of build arguments which are used during container build (for dockerfile.v0 resource type).",
"additionalProperties": {
"type": "string"
}
},
"bindings": {
"type": "object",
"description": "A list of port bindings for the resource when it is deployed.",
Expand Down
44 changes: 44 additions & 0 deletions src/test/aspire-8.0/withdockerfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://json.schemastore.org/aspire-8.0.json",
"resources": {
"goversion": {
"inputs": {
"value": {
"type": "string"
}
},
"type": "parameter.v0",
"value": "{goversion.inputs.value}"
},
"mycontainer": {
"build": {
"args": {
"GO_VERSION": "{goversion.value}"
},
"context": "qots",
"dockerfile": "qots/Dockerfile",
"secrets": {
"SECRET_ASENV": {
"type": "env",
"value": "{secret.value}"
},
"SECRET_ASFILE": {
"source": "Program.cs",
"type": "file"
}
}
},
"type": "container.v1"
},
"secret": {
"inputs": {
"value": {
"secret": true,
"type": "string"
}
},
"type": "parameter.v0",
"value": "{secret.inputs.value}"
}
}
}