Skip to content

Commit 41ea72d

Browse files
committed
Merge remote-tracking branch 'origin/main' into copilot/clean-up-deployment-logs
2 parents 36d0aab + d1deafe commit 41ea72d

30 files changed

+1351
-95
lines changed

Aspire.slnx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
<File Path="playground/README.md" />
107107
<Project Path="playground/Playground.ServiceDefaults/Playground.ServiceDefaults.csproj" />
108108
</Folder>
109+
<Folder Name="/playground/AspireWithJavaScript/">
110+
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.AppHost/AspireJavaScript.AppHost.csproj" />
111+
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.MinimalApi/AspireJavaScript.MinimalApi.csproj" />
112+
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.ServiceDefaults/AspireJavaScript.ServiceDefaults.csproj" />
113+
</Folder>
109114
<Folder Name="/playground/AzureAIFoundryEndToEnd/">
110115
<Project Path="playground/AzureAIFoundryEndToEnd/AzureAIFoundryEndToEnd.AppHost/AzureAIFoundryEndToEnd.AppHost.csproj" />
111116
<Project Path="playground/AzureAIFoundryEndToEnd/AzureAIFoundryEndToEnd.WebStory/AzureAIFoundryEndToEnd.WebStory.csproj" />
@@ -176,8 +181,8 @@
176181
<Project Path="playground/deployers/Deployers.AppHost/Deployers.AppHost.csproj" />
177182
</Folder>
178183
<Folder Name="/playground/DevTunnels/">
179-
<Project Path="playground/DevTunnels/DevTunnels.AppHost/DevTunnels.AppHost.csproj" />
180184
<Project Path="playground/DevTunnels/DevTunnels.ApiService/DevTunnels.ApiService.csproj" />
185+
<Project Path="playground/DevTunnels/DevTunnels.AppHost/DevTunnels.AppHost.csproj" />
181186
<Project Path="playground/DevTunnels/DevTunnels.WebFrontEnd/DevTunnels.WebFrontEnd.csproj" />
182187
</Folder>
183188
<Folder Name="/playground/dockerfile/">
@@ -199,11 +204,6 @@
199204
<Folder Name="/playground/HealthChecks/">
200205
<Project Path="playground/HealthChecks/HealthChecksSandbox.AppHost/HealthChecksSandbox.AppHost.csproj" />
201206
</Folder>
202-
<Folder Name="/playground/javascript/">
203-
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.AppHost/AspireJavaScript.AppHost.csproj" />
204-
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.MinimalApi/AspireJavaScript.MinimalApi.csproj" />
205-
<Project Path="playground/AspireWithJavaScript/AspireJavaScript.ServiceDefaults/AspireJavaScript.ServiceDefaults.csproj" />
206-
</Folder>
207207
<Folder Name="/playground/kafka/">
208208
<Project Path="playground/kafka/Consumer/Consumer.csproj" />
209209
<Project Path="playground/kafka/KafkaBasic.AppHost/KafkaBasic.AppHost.csproj" />
@@ -234,8 +234,8 @@
234234
</Folder>
235235
<Folder Name="/playground/node/">
236236
<Project Path="playground/AspireWithNode/AspireWithNode.AppHost/AspireWithNode.AppHost.csproj" />
237-
<Project Path="playground/AspireWithNode/AspireWithNode.ServiceDefaults/AspireWithNode.ServiceDefaults.csproj" />
238237
<Project Path="playground/AspireWithNode/AspireWithNode.AspNetCoreApi/AspireWithNode.AspNetCoreApi.csproj" />
238+
<Project Path="playground/AspireWithNode/AspireWithNode.ServiceDefaults/AspireWithNode.ServiceDefaults.csproj" />
239239
</Folder>
240240
<Folder Name="/playground/OpenAIEndToEnd/">
241241
<Project Path="playground/OpenAIEndToEnd/OpenAIEndToEnd.AppHost/OpenAIEndToEnd.AppHost.csproj" />
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
var builder = DistributedApplication.CreateBuilder(args);
1+
var builder = DistributedApplication.CreateBuilder(args);
22

33
var weatherApi = builder.AddProject<Projects.AspireJavaScript_MinimalApi>("weatherapi")
44
.WithExternalHttpEndpoints();
55

66
builder.AddNpmApp("angular", "../AspireJavaScript.Angular")
7+
.WithNpmPackageManager()
78
.WithReference(weatherApi)
89
.WaitFor(weatherApi)
910
.WithHttpEndpoint(env: "PORT")
1011
.WithExternalHttpEndpoints()
1112
.PublishAsDockerFile();
1213

1314
builder.AddNpmApp("react", "../AspireJavaScript.React")
15+
.WithNpmPackageManager()
1416
.WithReference(weatherApi)
1517
.WaitFor(weatherApi)
1618
.WithEnvironment("BROWSER", "none") // Disable opening browser on npm start
@@ -19,17 +21,17 @@
1921
.PublishAsDockerFile();
2022

2123
builder.AddNpmApp("vue", "../AspireJavaScript.Vue")
24+
.WithNpmPackageManager()
2225
.WithReference(weatherApi)
2326
.WaitFor(weatherApi)
2427
.WithHttpEndpoint(env: "PORT")
2528
.WithExternalHttpEndpoints()
2629
.PublishAsDockerFile();
2730

28-
builder.AddNpmApp("reactvite", "../AspireJavaScript.Vite")
31+
builder.AddViteApp("reactvite", "../AspireJavaScript.Vite")
32+
.WithNpmPackageManager()
2933
.WithReference(weatherApi)
3034
.WithEnvironment("BROWSER", "none")
31-
.WithHttpEndpoint(env: "VITE_PORT")
32-
.WithExternalHttpEndpoints()
33-
.PublishAsDockerFile();
35+
.WithExternalHttpEndpoints();
3436

3537
builder.Build().Run();

playground/AspireWithJavaScript/AspireJavaScript.AppHost/AspireJavaScript.AppHost.csproj

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,4 @@
1818
<ProjectReference Include="..\AspireJavaScript.MinimalApi\AspireJavaScript.MinimalApi.csproj" />
1919
</ItemGroup>
2020

21-
<Target Name="CheckNpmAvailable">
22-
<CheckCommandAvailable Command="npm">
23-
<Output TaskParameter="IsAvailable" PropertyName="IsNpmAvailable" />
24-
</CheckCommandAvailable>
25-
<Message Importance="Normal" Text="npm command is available: $(IsNpmAvailable)" />
26-
<Warning Text="npm is not available on PATH. Node.js package installation will be skipped. Install Node.js and npm to enable full functionality." Condition="'$(IsNpmAvailable)' == 'false'" />
27-
</Target>
28-
29-
<Target Name="RestoreNpm" BeforeTargets="Build" DependsOnTargets="CheckNpmAvailable" Condition="!('$(ContinuousIntegrationBuild)' == 'true') and '$(DesignTimeBuild)' != 'true' and '$(IsNpmAvailable)' == 'true' ">
30-
<ItemGroup>
31-
<PackageJsons Include="..\*\package.json" />
32-
</ItemGroup>
33-
34-
<!-- Install npm packages if node_modules is missing -->
35-
<Message Importance="Normal" Text="Installing npm packages for %(PackageJsons.RelativeDir)" Condition="!Exists('%(PackageJsons.RootDir)%(PackageJsons.Directory)/node_modules')" />
36-
<Exec Command="npm install" WorkingDirectory="%(PackageJsons.RootDir)%(PackageJsons.Directory)" Condition="!Exists('%(PackageJsons.RootDir)%(PackageJsons.Directory)/node_modules')" />
37-
</Target>
38-
3921
</Project>

playground/AspireWithJavaScript/AspireJavaScript.AppHost/aspire-manifest.json

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@
2727
}
2828
},
2929
"angular": {
30-
"type": "dockerfile.v0",
31-
"path": "../AspireJavaScript.Angular/Dockerfile",
32-
"context": "../AspireJavaScript.Angular",
30+
"type": "container.v1",
31+
"build": {
32+
"context": "../AspireJavaScript.Angular",
33+
"dockerfile": "../AspireJavaScript.Angular/Dockerfile"
34+
},
3335
"env": {
3436
"NODE_ENV": "development",
37+
"WEATHERAPI_HTTP": "{weatherapi.bindings.http.url}",
3538
"services__weatherapi__http__0": "{weatherapi.bindings.http.url}",
39+
"WEATHERAPI_HTTPS": "{weatherapi.bindings.https.url}",
3640
"services__weatherapi__https__0": "{weatherapi.bindings.https.url}",
3741
"PORT": "{angular.bindings.http.targetPort}"
3842
},
@@ -47,12 +51,16 @@
4751
}
4852
},
4953
"react": {
50-
"type": "dockerfile.v0",
51-
"path": "../AspireJavaScript.React/Dockerfile",
52-
"context": "../AspireJavaScript.React",
54+
"type": "container.v1",
55+
"build": {
56+
"context": "../AspireJavaScript.React",
57+
"dockerfile": "../AspireJavaScript.React/Dockerfile"
58+
},
5359
"env": {
5460
"NODE_ENV": "development",
61+
"WEATHERAPI_HTTP": "{weatherapi.bindings.http.url}",
5562
"services__weatherapi__http__0": "{weatherapi.bindings.http.url}",
63+
"WEATHERAPI_HTTPS": "{weatherapi.bindings.https.url}",
5664
"services__weatherapi__https__0": "{weatherapi.bindings.https.url}",
5765
"BROWSER": "none",
5866
"PORT": "{react.bindings.http.targetPort}"
@@ -68,12 +76,16 @@
6876
}
6977
},
7078
"vue": {
71-
"type": "dockerfile.v0",
72-
"path": "../AspireJavaScript.Vue/Dockerfile",
73-
"context": "../AspireJavaScript.Vue",
79+
"type": "container.v1",
80+
"build": {
81+
"context": "../AspireJavaScript.Vue",
82+
"dockerfile": "../AspireJavaScript.Vue/Dockerfile"
83+
},
7484
"env": {
7585
"NODE_ENV": "development",
86+
"WEATHERAPI_HTTP": "{weatherapi.bindings.http.url}",
7687
"services__weatherapi__http__0": "{weatherapi.bindings.http.url}",
88+
"WEATHERAPI_HTTPS": "{weatherapi.bindings.https.url}",
7789
"services__weatherapi__https__0": "{weatherapi.bindings.https.url}",
7890
"PORT": "{vue.bindings.http.targetPort}"
7991
},
@@ -86,6 +98,31 @@
8698
"external": true
8799
}
88100
}
101+
},
102+
"reactvite": {
103+
"type": "container.v1",
104+
"build": {
105+
"context": "../AspireJavaScript.Vite",
106+
"dockerfile": "reactvite.Dockerfile"
107+
},
108+
"env": {
109+
"NODE_ENV": "development",
110+
"PORT": "{reactvite.bindings.http.targetPort}",
111+
"WEATHERAPI_HTTP": "{weatherapi.bindings.http.url}",
112+
"services__weatherapi__http__0": "{weatherapi.bindings.http.url}",
113+
"WEATHERAPI_HTTPS": "{weatherapi.bindings.https.url}",
114+
"services__weatherapi__https__0": "{weatherapi.bindings.https.url}",
115+
"BROWSER": "none"
116+
},
117+
"bindings": {
118+
"http": {
119+
"scheme": "http",
120+
"protocol": "tcp",
121+
"transport": "http",
122+
"targetPort": 8003,
123+
"external": true
124+
}
125+
}
89126
}
90127
}
91128
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:22-slim
2+
WORKDIR /app
3+
COPY . .
4+
RUN npm install
5+
RUN npm run build

playground/AspireWithJavaScript/AspireJavaScript.Vite/Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Aspire.Cli/Commands/DeployCommand.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Aspire.Cli.Commands;
1515
internal sealed class DeployCommand : PublishCommandBase
1616
{
1717
private readonly Option<bool> _clearCacheOption;
18+
private readonly Option<string?> _stepOption;
1819

1920
public DeployCommand(IDotNetCliRunner runner, IInteractionService interactionService, IProjectLocator projectLocator, AspireCliTelemetry telemetry, IDotNetSdkInstaller sdkInstaller, IFeatures features, ICliUpdateNotifier updateNotifier, CliExecutionContext executionContext, ICliHostEnvironment hostEnvironment)
2021
: base("deploy", DeployCommandStrings.Description, runner, interactionService, projectLocator, telemetry, sdkInstaller, features, updateNotifier, executionContext, hostEnvironment)
@@ -24,6 +25,12 @@ public DeployCommand(IDotNetCliRunner runner, IInteractionService interactionSer
2425
Description = "Clear the deployment cache associated with the current environment and do not save deployment state"
2526
};
2627
Options.Add(_clearCacheOption);
28+
29+
_stepOption = new Option<string?>("--step")
30+
{
31+
Description = "Run a specific deployment step and its dependencies"
32+
};
33+
Options.Add(_stepOption);
2734
}
2835

2936
protected override string OperationCompletedPrefix => DeployCommandStrings.OperationCompletedPrefix;
@@ -61,6 +68,12 @@ protected override string[] GetRunArguments(string? fullyQualifiedOutputPath, st
6168
baseArgs.AddRange(["--environment", environment!]);
6269
}
6370

71+
var step = parseResult.GetValue(_stepOption);
72+
if (step != null)
73+
{
74+
baseArgs.AddRange(["--step", step]);
75+
}
76+
6477
baseArgs.AddRange(unmatchedTokens);
6578

6679
return [.. baseArgs];

0 commit comments

Comments
 (0)