mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-31 11:54:24 +01:00
Extract version in separate csproj to have better dockerfile caching
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="../Version.csproj" Condition="Exists('../Version.csproj')" />
|
||||
<Import Project="../Common.csproj" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.9" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="../Version.csproj" Condition="Exists('../Version.csproj')" />
|
||||
<Import Project="../Common.csproj" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Import Project="../Version.csproj" Condition="Exists('../Version.csproj')" />
|
||||
<Import Project="../Common.csproj" />
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<Version>1.0.3.106</Version>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Build\dockerfiles\**" />
|
||||
|
||||
7
Common.csproj
Normal file
7
Common.csproj
Normal file
@@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,12 +1,14 @@
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1.505-alpine3.7 AS builder
|
||||
WORKDIR /source
|
||||
COPY Common.csproj Common.csproj
|
||||
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
||||
COPY BTCPayServer.Common/BTCPayServer.Common.csproj BTCPayServer.Common/BTCPayServer.Common.csproj
|
||||
COPY BTCPayServer.Rating/BTCPayServer.Rating.csproj BTCPayServer.Rating/BTCPayServer.Rating.csproj
|
||||
RUN cd BTCPayServer && dotnet restore
|
||||
COPY BTCPayServer/. .
|
||||
COPY BTCPayServer.Rating/. .
|
||||
COPY BTCPayServer.Common/. .
|
||||
COPY Version.csproj Version.csproj
|
||||
COPY BTCPayServer/. BTCPayServer/.
|
||||
COPY BTCPayServer.Rating/. BTCPayServer.Rating/.
|
||||
COPY BTCPayServer.Common/. BTCPayServer.Common/.
|
||||
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.9-alpine3.7
|
||||
|
||||
@@ -4,13 +4,15 @@ RUN apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends qemu qemu-user-static qemu-user binfmt-support
|
||||
|
||||
WORKDIR /source
|
||||
COPY Common.csproj Common.csproj
|
||||
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
||||
COPY BTCPayServer.Common/BTCPayServer.Common.csproj BTCPayServer.Common/BTCPayServer.Common.csproj
|
||||
COPY BTCPayServer.Rating/BTCPayServer.Rating.csproj BTCPayServer.Rating/BTCPayServer.Rating.csproj
|
||||
RUN dotnet restore
|
||||
COPY BTCPayServer/. .
|
||||
COPY BTCPayServer.Rating/. .
|
||||
COPY BTCPayServer.Common/. .
|
||||
COPY Version.csproj Version.csproj
|
||||
COPY BTCPayServer/. BTCPayServer/.
|
||||
COPY BTCPayServer.Rating/. BTCPayServer.Rating/.
|
||||
COPY BTCPayServer.Common/. BTCPayServer.Common/.
|
||||
RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
|
||||
|
||||
# Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program
|
||||
|
||||
5
Version.csproj
Normal file
5
Version.csproj
Normal file
@@ -0,0 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.0.3.106</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
$ver = [regex]::Match((Get-Content BTCPayServer\BTCPayServer.csproj), '<Version>([^<]+)<').Groups[1].Value
|
||||
$ver = [regex]::Match((Get-Content Version.csproj), '<Version>([^<]+)<').Groups[1].Value
|
||||
git tag -a "v$ver" -m "$ver"
|
||||
git checkout latest
|
||||
git merge master
|
||||
|
||||
Reference in New Issue
Block a user