0

I'm trying to fully automate our API/microservice business model by writing up a bat script that:

  • First: Create a new .NET core web API using input as the name and input as location and input as version. (Also selecting or unselecting "Configure for HTTPS" & "Enable Docker")
  • Second: Automatically install all NuGet packages needed for our boiler plate API.
  • Third: Automatically create or delete files/folders such as deleting any default boiler plate code and adding a "Models" file.
  • Fourth: Automatically running the Scaffold-DBContext PM command with input as the details for CL command flags and connection string. And then move the connection string to appsettings.json
  • Fifth: Automatically Create Scaffolded items such as API Controllers with actions, using Entity Framework and then clean them up and add any extra code needed for our boiler plate API's.
  • Sixth: Add static and custom files grabbed from online services such as pastebin or gitgub or etc. Such as security and login classes, extra function code and etc.

Any help pointing in the direction of information/details on scripting this sort of automation in bat scripts or py scripts would be great.

IF anyone has done anything similar before, sharing code snippets would be immensely helpful.

Thanks

Aquaphor
  • 129
  • 10
  • At least part of it can e done with custom `dotnet new` [templates](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates) – Guru Stron May 23 '21 at 21:45
  • @GuruStron that's actually very helpful for the first point. Thanks. – Aquaphor May 23 '21 at 22:52
  • Actually I would say that everything except 6 point (didn't fully understood that one) can be solved by creating custom template. – Guru Stron May 24 '21 at 05:48

0 Answers0