Running dotnet ef database update on tfs build agent

entity-framework-core tfs

Question

I'm trying to make a CD setup which migrates my target database on release in TFS 2017 (update 3). My artifacts only contains my website assemblies, with DB context and controllers etc. If I update my database during build (and not during release) I can run

dotnet restore dotnet ef database update

and it works nicely, but this ofcourse does not work during release, as the source code is not available in the artifacts, and dotnet restore requires the .csproj file.

Anyone have suggestion of how to set up migrations during release? Do I need to include my source in the artifacts?

I'm using .net core 2.0 and ef core 2.0

1
0
9/20/2017 10:26:25 AM

Popular Answer

If you run dotnet ef database update with the --verbose option, you'll see a call to dotnet exec ef.dll. This is the command you can use directly on the binaries without needing the source code.

0
9/25/2017 4:34:07 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow