forked from featurehub-io/featurehub-dotnet-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
16 lines (14 loc) · 787 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build-env
ARG Version
WORKDIR /app
ADD . /app
RUN dotnet restore FeatureHubSDK.sln
RUN dotnet publish -c Release -o out
RUN dotnet test
RUN cd FeatureHubSDK && dotnet build /p:PackageVersion=$Version -c Release --no-restore && \
dotnet pack /p:PackageVersion=$Version -c Release --no-restore --no-build -o /sln/artifacts
ENTRYPOINT ["dotnet", "nuget", "push", "/sln/artifacts/*.nupkg"]
CMD ["--source", "https://api.nuget.org/v3/index.json"]
# build with docker build --build-arg Version=2.1.0 -t featurehub-sdk-csharp .
# examine with: docker run --rm -it --entrypoint "/bin/sh" featurehub-sdk-csharp -c /bin/bash
# deploy with docker run --rm featurehub-sdk-csharp --source https://api.nuget.org/v3/index.json --api-key MY-SECRET-KEY