From 450fd643f294b4a58c924b9ba8b008388a9f1d24 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 19 Apr 2021 15:17:31 -0400 Subject: [PATCH] - adds docker documentation --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd1b4a463a..4f919a4411 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,32 @@ No additional tools are required for dotnet projects. ### Generating SDKs -Installing the tools and cloning this repository, you will need to build Kiota. You can either use Visual Studio Code or Visual Studio or execute the following commands: +Installing the tools and cloning this repository, you will you can either build Kiota or use it with docker. + +#### Running Kiota with Docker + +1. Navigate to [New personnal access token](https://github.com/settings/tokens/new) and generat a new token. (permissions: read:package). +1. Copy the token, you will need it later. +1. Enable the SSO on the token if you are a Microsoft employee. +1. Execute the following command to login to the registry. + + ```Shell + echo "" | docker login https://docker.pkg.github.com/microsoft/kiota/generator -u baywet --password-stdin + ``` + +1. Execute the following command to start generating SDKs + + ```Shell + docker run -v /some/output/path:/app/output -v /some/input/description.yml:/app/openapi.yml docker.pkg.github.com/microsoft/kiota/generator --language csharp -n samespaceprefix + ``` + + > Note: you can alternatively use the --openapi parameter with a URI instead of volume mapping. + +> Note: steps 1-4 only need to be done once per machine. + +#### Building Kiota + +First, clone the current repository. You can either use Visual Studio Code or Visual Studio or execute the following commands: ```Shell dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -r win-x64 @@ -42,6 +67,8 @@ dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -r Navigate to the output directory (usually under `src/kiota/bin/Release/net5.0`) and start generating SDKs by running Kiota. +#### Running Kiota from binaries + ```Shell kiota.exe --openapi ../msgraph-sdk-powershell/openApiDocs/v1.0/mail.yml --language csharp -o ../somepath -n samespaceprefix ```