Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ applications:
- binary_buildpack
memory: 256M
random-route: true
stack: windows2022
stack: windows
command: cmd /c .\Steeltoe.Samples.ConfigurationProviders --urls=http://0.0.0.0:%PORT%
env:
# ASPNETCORE_ENVIRONMENT value is lower-cased here to match the files in the config repository at:
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/MongoDb/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: mongodb-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.MongoDb --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/MySql/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: mysql-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.MySql --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/MySqlEFCore/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: mysql-efcore-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.MySqlEFCore --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/PostgreSql/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: postgresql-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.PostgreSql --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/PostgreSqlEFCore/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: postgresql-efcore-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.PostgreSqlEFCore --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/RabbitMQ/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: rabbitmq-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.RabbitMQ --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/Redis/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: redis-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.Redis --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion Connectors/src/SqlServerEFCore/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: sqlserver-efcore-connector-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.SqlServerEFCore --urls=http://0.0.0.0:%PORT%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: fortune-service-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.FortuneTellerApi --urls=http://0.0.0.0:%PORT%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: fortune-web-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.FortuneTellerWeb --urls=http://0.0.0.0:%PORT%
Expand Down
2 changes: 1 addition & 1 deletion FileShares/src/FileSharesWeb/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: fileshares-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.FileSharesWeb --urls=http://0.0.0.0:%PORT%
Expand Down
16 changes: 13 additions & 3 deletions Management/src/ActuatorApi/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Steeltoe Management Sample - Actuators, Administrative Tasks, Metrics and Tracing
# Steeltoe Management Sample - Actuators, Administrative Tasks, Metrics and Tracing

ActuatorWeb and ActuatorApi form an ASP.NET Core-powered sample application that demonstrates how to use several Steeltoe libraries on their own and with additional tools.

Expand Down Expand Up @@ -84,8 +84,18 @@ In order to demonstrate [Steeltoe Management Tasks](https://docs.steeltoe.io/api
cf create-service csb-aws-mysql your-plan sampleActuatorMySqlService --wait
```

1. Run the `cf push` command to deploy from source (you can monitor logs with `cf logs actuator-api-management-sample`)
- When deploying to Windows, binaries must be built locally before push. Use the following commands instead:
1. Deploy the app

You can monitor logs with: `cf logs actuator-api-management-sample`.

- To deploy local sources, run the following commands:

```shell
dotnet build -t:WriteGitPropertiesFallbackFile
cf push
```

- To deploy locally-built binaries (required if deploying to Windows), run the following commands:

```shell
dotnet publish -r win-x64 --self-contained
Expand Down
37 changes: 1 addition & 36 deletions Management/src/ActuatorApi/Steeltoe.Samples.ActuatorApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Do not override package/assembly/file version with the version from git metadata when using GitInfo. -->
<GitVersion>false</GitVersion>
<!-- Do not generate (unused) C# classes from git metadata when using GitInfo. -->
<GitThisAssembly>false</GitThisAssembly>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,40 +21,10 @@
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="$(EFCoreVersion)" />
<PackageReference Include="Steeltoe.Connectors.EntityFrameworkCore" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.GitProperties.Build" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.Prometheus" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.Tasks" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.Tracing" Version="$(SteeltoeVersion)" />
</ItemGroup>

<!--
In order to prevent build issues with processing a nonexistent .git folder (such as during staging in Cloud Foundry),
the following sections are only evaluated when the environment variable "CF_STACK" is NOT set.
-->
<ItemGroup Condition="'$(CF_STACK)' == ''">
<PackageReference Include="GitInfo" Version="3.5.*" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="WriteGitPropertiesToFile" AfterTargets="CoreCompile" Condition="'$(CF_STACK)' == ''">
<!-- Generate git.properties file from the MSBuild properties provided by the GitInfo NuGet package. -->
<!-- https://github.com/devlooped/GitInfo/blob/main/src/GitInfo/build/GitInfo.targets -->
<WriteLinesToFile File="git.properties" Lines="git.remote.origin.url=$(GitRepositoryUrl)" Overwrite="true" />
<WriteLinesToFile File="git.properties" Lines="git.build.version=$(GitBaseVersion)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.id.abbrev=$(GitCommit)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.id=$(GitSha)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.time=$(GitCommitDate)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.tags=$(GitTag)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.branch=$(GitBranch)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.time=$([System.DateTime]::Now.ToString('O'))" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.user.name=$([System.Environment]::GetEnvironmentVariable('USERNAME'))" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.host=$([System.Environment]::GetEnvironmentVariable('COMPUTERNAME'))" Overwrite="false" />
</Target>

<ItemGroup Condition="'$(CF_STACK)' == ''">
<None Update="git.properties">
<!-- Ensure that the git.properties file ends up in the Publish directory. -->
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Management/src/ActuatorApi/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ applications:
buildpacks:
- binary_buildpack
memory: 256M
stack: windows2022
stack: windows
command: cmd /c .\Steeltoe.Samples.ActuatorApi --urls http://0.0.0.0:%PORT%
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
Expand Down
29 changes: 17 additions & 12 deletions Management/src/ActuatorWeb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,26 @@ When running with Podman, update these files to use `host.containers.internal`:

## Running on Tanzu Platform for Cloud Foundry

1. Run the `cf push` command to deploy from source (you can monitor logs with `cf logs actuator-web-management-sample`)
* When deploying to Windows (or to see `git.properties` in the Info actuator response), binaries must be built locally before push. Use the following commands instead:
1. Deploy the app

```shell
dotnet publish -r win-x64 --self-contained
cf push -f manifest-windows.yml -p bin/Release/net10.0/win-x64/publish
```
You can monitor logs with: `cf logs actuator-web-management-sample`.

> [!NOTE]
> These applications use the GitInfo NuGet package to write a `git.properties` if the .git folder is found.
> When the staging process runs on Cloud Foundry, that information is not available.
> If you want to see git properties returned when the application is running on Cloud Foundry, publish the application before pushing.
- To deploy local sources, run the following commands:

```shell
dotnet build -t:WriteGitPropertiesFallbackFile
cf push
```

- To deploy locally-built binaries (required if deploying to Windows), run the following commands:

```shell
dotnet publish -r win-x64 --self-contained
cf push -f manifest-windows.yml -p bin/Release/net10.0/win-x64/publish
```

2. Copy the value of `routes` in the output and open in your browser
3. Refer to [ActuatorApi README](../ActuatorApi/README.md#running-on-tanzu-platform-for-cloud-foundry) for additional instructions.
1. Copy the value of `routes` in the output and open in your browser
1. Refer to [ActuatorApi README](../ActuatorApi/README.md#running-on-tanzu-platform-for-cloud-foundry) for additional instructions.

### What to expect

Expand Down
37 changes: 1 addition & 36 deletions Management/src/ActuatorWeb/Steeltoe.Samples.ActuatorWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Do not override package/assembly/file version with the version from git metadata when using GitInfo. -->
<GitVersion>false</GitVersion>
<!-- Do not generate (unused) C# classes from git metadata when using GitInfo. -->
<GitThisAssembly>false</GitThisAssembly>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,39 +14,9 @@
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="Steeltoe.Configuration.CloudFoundry" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.GitProperties.Build" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.Prometheus" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Management.Tracing" Version="$(SteeltoeVersion)" />
</ItemGroup>

<!--
In order to prevent build issues with processing a nonexistent .git folder (such as during staging in Cloud Foundry),
the following sections are only evaluated when the environment variable "CF_STACK" is NOT set.
-->
<ItemGroup Condition="'$(CF_STACK)' == ''">
<PackageReference Include="GitInfo" Version="3.5.*" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="WriteGitPropertiesToFile" AfterTargets="CoreCompile" Condition="'$(CF_STACK)' == ''">
<!-- Generate git.properties file from the MSBuild properties provided by the GitInfo NuGet package. -->
<!-- https://github.com/devlooped/GitInfo/blob/main/src/GitInfo/build/GitInfo.targets -->
<WriteLinesToFile File="git.properties" Lines="git.remote.origin.url=$(GitRepositoryUrl)" Overwrite="true" />
<WriteLinesToFile File="git.properties" Lines="git.build.version=$(GitBaseVersion)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.id.abbrev=$(GitCommit)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.id=$(GitSha)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.commit.time=$(GitCommitDate)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.tags=$(GitTag)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.branch=$(GitBranch)" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.time=$([System.DateTime]::Now.ToString('O'))" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.user.name=$([System.Environment]::GetEnvironmentVariable('USERNAME'))" Overwrite="false" />
<WriteLinesToFile File="git.properties" Lines="git.build.host=$([System.Environment]::GetEnvironmentVariable('COMPUTERNAME'))" Overwrite="false" />
</Target>

<ItemGroup Condition="'$(CF_STACK)' == ''">
<None Update="git.properties">
<!-- Ensure that the git.properties file ends up in the Publish directory. -->
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Management/src/ActuatorWeb/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ applications:
buildpacks:
- binary_buildpack
memory: 256M
stack: windows2022
stack: windows
command: cmd /c .\Steeltoe.Samples.ActuatorWeb --urls http://0.0.0.0:%PORT%
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
Expand Down
2 changes: 1 addition & 1 deletion Security/src/AuthApi/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ applications:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.AuthApi --urls=http://0.0.0.0:%PORT%
memory: 256M
stack: windows2022
stack: windows
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
DOTNET_NOLOGO: "true"
Expand Down
2 changes: 1 addition & 1 deletion Security/src/AuthConsole/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ applications:
health-check-type: process
memory: 256M
no-route: true
stack: windows2022
stack: windows
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
DOTNET_NOLOGO: "true"
2 changes: 1 addition & 1 deletion Security/src/AuthWeb/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ applications:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.AuthWeb --urls=http://0.0.0.0:%PORT%
memory: 256M
stack: windows2022
stack: windows
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
DOTNET_NOLOGO: "true"
Expand Down
2 changes: 1 addition & 1 deletion Security/src/RedisDataProtection/manifest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ applications:
- name: redis-data-protection-sample
random-route: true
memory: 256M
stack: windows2022
stack: windows
buildpacks:
- binary_buildpack
command: cmd /c .\Steeltoe.Samples.RedisDataProtection --urls=http://0.0.0.0:%PORT%
Expand Down