Skip to content
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
10 changes: 10 additions & 0 deletions src/Schema/aspire-8.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
},
"bindings": {
"$ref": "#/definitions/bindings"
},
"buildArgs": {
"$ref": "#/definitions/buildArgs"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -524,6 +527,13 @@
},
"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 tests/Aspire.Hosting.Tests/Schema/SchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,50 @@ public void ManifestWithContainerV1ResourceAndBuildFieldIsAccepted()
AssertValid(manifestText);
}

[Fact]
public void ManifestWithDockerfileV0ResourceAndBuildFieldAndArgsIsAccepted()
{
var manifestText = """
{
"resources": {
"mycontainer": {
"type": "dockerfile.v0",
"context": "relativepath",
"path": "relativepath/Dockerfile",
"buildArgs": {
"ARG1": "an arg"
}
}
}
}
""";

AssertValid(manifestText);
}

[Fact]
public void ManifestWithContainerV1ResourceAndBuildFieldAndArgsIsAccepted()
{
var manifestText = """
{
"resources": {
"mycontainer": {
"type": "container.v1",
"build": {
"context": "relativepath",
"dockerfile": "relativepath/Dockerfile",
"args": {
"ARG1": "an arg"
}
}
}
}
}
""";

AssertValid(manifestText);
}

[Fact]
public void ManifestWithContainerV1ResourceAndImageFieldIsAccepted()
{
Expand Down
Loading