Switch production server from dotnet run to published standalone exe#79
Merged
Conversation
Replace 'dotnet run -c Release' with 'dotnet publish' + launch Treemon.exe directly. The production process is now named Treemon.exe instead of dotnet.exe, so dotnet build/test operations cannot accidentally kill it via name-based process matching. - Set AssemblyName to Treemon in Server.fsproj - Add publish step to Start-ProductionServer (dotnet publish -c Release) - Launch .publish/Treemon.exe instead of dotnet run - Add .publish/ to .gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Production
start/restartlaunched the server withdotnet run -c Release --project src/Server. Withdotnet run,Start-Processtracks thedotnetCLI host PID rather than the actual server process, which undermines the script's PID-file-basedstop/statuslifecycle logic intreemon.ps1.Changes
treemon.ps1:Start-ProductionServernow runsdotnet publish -c Release -o .publishand launches the publishedTreemon.exedirectly, yielding a clean server PID for the.treemon.pidfile. A failed publish aborts the start.src/Server/Server.fsproj: add<AssemblyName>Treemon</AssemblyName>so the published binary isTreemon.exe(the project file isServer.fsproj, which would otherwise emitServer.exe)..gitignore: ignore the new.publish/output directory.Tests
dotnet publish -c Release -o .publish src/Server/Server.fsprojsucceeds and produces.publish\Treemon.exe.