Skip to content

Commit

Permalink
Refactor container properties
Browse files Browse the repository at this point in the history
Move some properties into `Directory.Build.props` for re-use and less clutter for things that aren't project-specific.
  • Loading branch information
martincostello committed Apr 29, 2024
1 parent 2cb0a6e commit 67771b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
13 changes: 13 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateGitMetadata Condition=" '$(CI)' != '' and '$(GenerateGitMetadata)' == '' ">true</GenerateGitMetadata>
Expand Down Expand Up @@ -54,4 +55,16 @@
<ItemGroup>
<Using Include="System.Globalization" />
</ItemGroup>
<PropertyGroup Condition=" '$(CI)' == 'true' ">
<ContainerImageTags>github-$(GITHUB_RUN_NUMBER)</ContainerImageTags>
<ContainerImageTags Condition=" '$(GITHUB_HEAD_REF)' == '' ">$(ContainerImageTags);latest</ContainerImageTags>
<ContainerRepository>$(GITHUB_REPOSITORY)</ContainerRepository>
<ContainerTitle>$(GITHUB_REPOSITORY)</ContainerTitle>
<ContainerVendor>$(GITHUB_REPOSITORY_OWNER)</ContainerVendor>
<ContainerVersion>$(GITHUB_SHA)</ContainerVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(CI)' == 'true' ">
<ContainerLabel Include="com.docker.extension.changelog" Value="$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY)/commit/$(GITHUB_SHA)" />
<ContainerLabel Include="com.docker.extension.publisher-url" Value="$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY_OWNER)" />
</ItemGroup>
</Project>
19 changes: 2 additions & 17 deletions src/LondonTravel.Site/LondonTravel.Site.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<NoWarn>$(NoWarn);CA1716</NoWarn>
<OutputType>Exe</OutputType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PublishSelfContained>true</PublishSelfContained>
<RootNamespace>MartinCostello.LondonTravel.Site</RootNamespace>
<SatelliteResourceLanguages>en;en-GB;en-US;qps-Ploc</SatelliteResourceLanguages>
<Summary>Website for the London Travel Amazon Alexa skill.</Summary>
Expand All @@ -20,24 +21,7 @@
<!-- TODO Remove if https://github.com/dotnet/sdk/issues/40500 implemented or when no longer only in nightly -->
<ContainerBaseImage>mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-noble-chiseled-extra</ContainerBaseImage>
<ContainerFamily>noble-chiseled-extra</ContainerFamily>
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
<PublishSelfContained>true</PublishSelfContained>
</PropertyGroup>
<PropertyGroup Condition=" '$(CI)' == 'true' ">
<ContainerImageTags>github-$(GITHUB_RUN_NUMBER)</ContainerImageTags>
<ContainerImageTags Condition=" '$(GITHUB_HEAD_REF)' == '' ">$(ContainerImageTags);latest</ContainerImageTags>
<ContainerRepository>$(GITHUB_REPOSITORY)</ContainerRepository>
<ContainerTitle>$(GITHUB_REPOSITORY)</ContainerTitle>
<ContainerVendor>$(GITHUB_REPOSITORY_OWNER)</ContainerVendor>
<ContainerVersion>$(GITHUB_SHA)</ContainerVersion>
</PropertyGroup>
<ItemGroup>
<ContainerPort Include="8080" Type="tcp" />
</ItemGroup>
<ItemGroup Condition=" '$(CI)' == 'true' ">
<ContainerLabel Include="com.docker.extension.changelog" Value="$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY)/commit/$(GITHUB_SHA)" />
<ContainerLabel Include="com.docker.extension.publisher-url" Value="$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY_OWNER)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.Amazon" />
<PackageReference Include="AspNet.Security.OAuth.Apple" />
Expand Down Expand Up @@ -67,6 +51,7 @@
<PackageReference Include="Polly.RateLimiting" />
</ItemGroup>
<ItemGroup>
<ContainerPort Include="8080" Type="tcp" />
<Content Update=".prettierignore;coverage\**;package.json;package-lock.json;tsconfig.json" CopyToPublishDirectory="Never" />
<EmbeddedResource Update="SiteResources.resx" Generator="" />
<InternalsVisibleTo Include="LondonTravel.Site.Tests" />
Expand Down

0 comments on commit 67771b7

Please sign in to comment.