Prepare a release
Write Wolverine's generated code into the Host before the Release build, publish the Host without a runtime compiler, and migrate before it starts.
What you build
A Release publish of the Host that starts outside Development. There, Wolverine loads its generated handler code from the Host's assembly instead of compiling it when the Host starts, and the Host's Release build carries no runtime compiler. The step before the release writes that code into the Host project.
When to use it
Before every Release publish of a Host, or as a step of the build before the publish. Write the code again whenever a Wolverine handler or a Saga changes.
Steps
Write Wolverine's generated code
The generated Host's command line is JasperFx's, so this step builds the Host and never starts it: it needs no database and no runtime compiler.
dotnet run --project src/Acme.Shop.Host -- codegen writeIt writes the code into the Host project. Commit it, as Wolverine's own guide does: Pre-generating Wolverine's code for production names the folder.
Publish the Host
dotnet publish src/Acme.Shop.Host -c Release -o publishPublish with its own restore: a restore made for another build configuration brings the runtime compiler back into the publish. Pre-generating Wolverine's code for production gives the restore to use otherwise.
Migrate the database
The Host applies no migration when it starts. Apply each Module's migrations before the new version runs: see Add a migration. Wolverine still creates its own message storage when the Host starts.
Configure it for production
Configure the Host through settings files, user secrets or the environment: an argument on its command line that is no JasperFx command stops it. In production, configure the issuer, audiences and signing keys of your real identity provider.
To move a generated solution to another Kit version, change the Kit version its central package versions pin: see Install and generate.
What the Kit guarantees
| Guarantee | Stated in |
|---|---|
| What the step writes, and when a Host needs it | Pre-generating Wolverine's code for production |
| Static code loading outside Development | Declaring handlers and running deliveries |
| A Host with Sagas | The Host |
| The Kit version a generated project pins | Install and generate |