-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding different build architectures (x64 & arm64) and using docker b…
…uild to now publish nuget packages.
- Loading branch information
1 parent
4608b4c
commit 5f95d62
Showing
18 changed files
with
261 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"runtimeTarget": { | ||
"name": ".NETCoreApp,Version=v6.0/linux-arm64", | ||
"signature": "" | ||
}, | ||
"compilationOptions": {}, | ||
"targets": { | ||
".NETCoreApp,Version=v6.0": {}, | ||
".NETCoreApp,Version=v6.0/linux-arm64": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"dependencies": { | ||
"FormatWith": "3.0.1" | ||
}, | ||
"runtime": { | ||
"HashiVaultCs.dll": {} | ||
} | ||
}, | ||
"FormatWith/3.0.1": { | ||
"runtime": { | ||
"lib/netstandard2.0/FormatWith.dll": { | ||
"assemblyVersion": "3.0.1.0", | ||
"fileVersion": "3.0.1.0" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"libraries": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"type": "project", | ||
"serviceable": false, | ||
"sha512": "" | ||
}, | ||
"FormatWith/3.0.1": { | ||
"type": "package", | ||
"serviceable": true, | ||
"sha512": "sha512-qAgVI8A9l33ZoOS/16slW82YktWWezb4sx535lGqdHSPB3ULVKWg6BJ4oi3FltFjNiMa3bypqFdmoFFgHZxkdA==", | ||
"path": "formatwith/3.0.1", | ||
"hashPath": "formatwith.3.0.1.nupkg.sha512" | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"runtimeTarget": { | ||
"name": ".NETCoreApp,Version=v6.0/linux-x64", | ||
"signature": "" | ||
}, | ||
"compilationOptions": {}, | ||
"targets": { | ||
".NETCoreApp,Version=v6.0": {}, | ||
".NETCoreApp,Version=v6.0/linux-x64": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"dependencies": { | ||
"FormatWith": "3.0.1" | ||
}, | ||
"runtime": { | ||
"HashiVaultCs.dll": {} | ||
} | ||
}, | ||
"FormatWith/3.0.1": { | ||
"runtime": { | ||
"lib/netstandard2.0/FormatWith.dll": { | ||
"assemblyVersion": "3.0.1.0", | ||
"fileVersion": "3.0.1.0" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"libraries": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"type": "project", | ||
"serviceable": false, | ||
"sha512": "" | ||
}, | ||
"FormatWith/3.0.1": { | ||
"type": "package", | ||
"serviceable": true, | ||
"sha512": "sha512-qAgVI8A9l33ZoOS/16slW82YktWWezb4sx535lGqdHSPB3ULVKWg6BJ4oi3FltFjNiMa3bypqFdmoFFgHZxkdA==", | ||
"path": "formatwith/3.0.1", | ||
"hashPath": "formatwith.3.0.1.nupkg.sha512" | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"runtimeTarget": { | ||
"name": ".NETCoreApp,Version=v6.0/win-arm64", | ||
"signature": "" | ||
}, | ||
"compilationOptions": {}, | ||
"targets": { | ||
".NETCoreApp,Version=v6.0": {}, | ||
".NETCoreApp,Version=v6.0/win-arm64": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"dependencies": { | ||
"FormatWith": "3.0.1" | ||
}, | ||
"runtime": { | ||
"HashiVaultCs.dll": {} | ||
} | ||
}, | ||
"FormatWith/3.0.1": { | ||
"runtime": { | ||
"lib/netstandard2.0/FormatWith.dll": { | ||
"assemblyVersion": "3.0.1.0", | ||
"fileVersion": "3.0.1.0" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"libraries": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"type": "project", | ||
"serviceable": false, | ||
"sha512": "" | ||
}, | ||
"FormatWith/3.0.1": { | ||
"type": "package", | ||
"serviceable": true, | ||
"sha512": "sha512-qAgVI8A9l33ZoOS/16slW82YktWWezb4sx535lGqdHSPB3ULVKWg6BJ4oi3FltFjNiMa3bypqFdmoFFgHZxkdA==", | ||
"path": "formatwith/3.0.1", | ||
"hashPath": "formatwith.3.0.1.nupkg.sha512" | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"runtimeTarget": { | ||
"name": ".NETCoreApp,Version=v6.0/win-x64", | ||
"signature": "" | ||
}, | ||
"compilationOptions": {}, | ||
"targets": { | ||
".NETCoreApp,Version=v6.0": {}, | ||
".NETCoreApp,Version=v6.0/win-x64": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"dependencies": { | ||
"FormatWith": "3.0.1" | ||
}, | ||
"runtime": { | ||
"HashiVaultCs.dll": {} | ||
} | ||
}, | ||
"FormatWith/3.0.1": { | ||
"runtime": { | ||
"lib/netstandard2.0/FormatWith.dll": { | ||
"assemblyVersion": "3.0.1.0", | ||
"fileVersion": "3.0.1.0" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"libraries": { | ||
"HashiVaultCs/1.1.1.3": { | ||
"type": "project", | ||
"serviceable": false, | ||
"sha512": "" | ||
}, | ||
"FormatWith/3.0.1": { | ||
"type": "package", | ||
"serviceable": true, | ||
"sha512": "sha512-qAgVI8A9l33ZoOS/16slW82YktWWezb4sx535lGqdHSPB3ULVKWg6BJ4oi3FltFjNiMa3bypqFdmoFFgHZxkdA==", | ||
"path": "formatwith/3.0.1", | ||
"hashPath": "formatwith.3.0.1.nupkg.sha512" | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Build: docker build --no-cache -t hashivaultcs:dev-arm64 --file Dockerfile.build.arm64 . | ||
## Once the image is built, get the list of avaiable images in the local docker registry: docker image ls | ||
## Run the following command with corresponding the image id: docker run --name hashivaultcs-dev-arm64 -td <image-id /> | ||
## This will run an empry container (nothing will happen) - you can connect and grab the files from it | ||
|
||
FROM mcr.microsoft.com/dotnet/runtime:6.0-focal-arm64v8 AS base-arm64 | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal-arm64v8 AS build-arm64 | ||
WORKDIR /src-arm64 | ||
|
||
COPY ["Client/Client.csproj", "Client/"] | ||
RUN dotnet restore "Client/Client.csproj" | ||
COPY . . | ||
|
||
WORKDIR "/src-arm64/Client" | ||
RUN dotnet build "Client.csproj" --os linux -a arm64 -c Release -o /app/build-arm64/bin/Release/net6.0/linux-arm64 | ||
RUN dotnet build "Client.csproj" --os win -a arm64 -c Release -o /app/build-arm64/bin/Release/net6.0/win-arm64 | ||
|
||
FROM build-arm64 AS publish-arm64 | ||
RUN dotnet publish "Client.csproj" --os linux -a arm64 -c Release -o /app/publish-arm64/bin/Release/net6.0/linux-arm64 | ||
RUN dotnet publish "Client.csproj" --os win -a arm64 -c Release -o /app/publish-arm64/bin/Release/net6.0/win-arm64 | ||
|
||
FROM base-arm64 AS final-arm64 | ||
WORKDIR /app | ||
COPY --from=publish-arm64 /app/publish-arm64/bin/Release ./runtime/arm64/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Build: docker build --no-cache -t hashivaultcs:dev-x64 --file Dockerfile.build.x64 . | ||
## Once the image is built, get the list of avaiable images in the local docker registry: docker image ls | ||
## Run the following command with corresponding the image id: docker run --name hashivaultcs-dev-x64 -td <image-id /> | ||
## This will run an empry container (nothing will happen) - you can connect and grab the files from it | ||
|
||
FROM mcr.microsoft.com/dotnet/runtime:6.0-focal-amd64 AS base-x64 | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal-amd64 AS build-x64 | ||
WORKDIR /src-x64 | ||
|
||
COPY ["Client/Client.csproj", "Client/"] | ||
RUN dotnet restore "Client/Client.csproj" | ||
COPY . . | ||
|
||
WORKDIR "/src-x64/Client" | ||
RUN dotnet build "Client.csproj" --os linux -a x64 -c Release -o /app/build-x64/bin/Release/net6.0/linux-x64 | ||
RUN dotnet build "Client.csproj" --os win -a x64 -c Release -o /app/build-x64/bin/Release/net6.0/win-x64 | ||
|
||
FROM build-x64 AS publish-x64 | ||
RUN dotnet publish "Client.csproj" --os linux -a x64 -c Release -o /app/publish-x64/bin/Release/net6.0/linux-x64 | ||
RUN dotnet publish "Client.csproj" --os win -a x64 -c Release -o /app/publish-x64/bin/Release/net6.0/win-x64 | ||
|
||
FROM base-x64 AS final-x64 | ||
WORKDIR /app | ||
COPY --from=publish-x64 /app/publish-x64/bin/Release ./runtime/x64/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Build: docker build --no-cache --build-arg NUGET_KEY=<replace-nuget-api-key-here /> --build-arg NUGET_URL=https://api.nuget.org/v3/index.json --file Dockerfile.nuget.publish . | ||
## This will publish the Client project to the public nuget registry | ||
|
||
FROM mcr.microsoft.com/dotnet/runtime:6.0-focal-amd64 AS base-x64 | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal-amd64 AS build-x64 | ||
ARG NUGET_KEY | ||
ARG NUGET_URL | ||
WORKDIR /src-x64 | ||
|
||
COPY ["Client/Client.csproj", "Client/"] | ||
RUN dotnet restore "Client/Client.csproj" | ||
COPY . . | ||
|
||
WORKDIR "/src-x64/Client" | ||
RUN dotnet build "Client.csproj" -c Release -o /app/build-x64/bin/Release/net6.0 | ||
RUN dotnet pack "Client.csproj" -c Release -o /app/build-x64/bin/Release/net6.0/publish | ||
RUN dotnet nuget push /app/build-x64/bin/Release/net6.0/publish/HashiVaultCs.*.nupkg -s $NUGET_URL -k $NUGET_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.