PouryaKit
Guides

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.

A Host with Wolverine handlers or Sagas of its own needs the step

The Kit's own deliveries need no generated code, so a Kit Host still starts without it. Once the application adds Wolverine handlers of its own, or a Saga, each has a generated type, and a Host published without it does not start.

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.

Terminal
dotnet run --project src/Acme.Shop.Host -- codegen write

It 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

Terminal
dotnet publish src/Acme.Shop.Host -c Release -o publish

Publish 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

GuaranteeStated in
What the step writes, and when a Host needs itPre-generating Wolverine's code for production
Static code loading outside DevelopmentDeclaring handlers and running deliveries
A Host with SagasThe Host
The Kit version a generated project pinsInstall and generate

Failure messages

Next steps

On this page