Server Update Steps: Difference between revisions

m
Complete rewrite for automated CI/CD deployment flow
m (Complete rewrite for automated CI/CD deployment flow)
 
Line 1: Line 1:
== NWSync Server Setup ==
All deployments are managed through GitHub PRs, CI pipelines, and the Discord dashboard. No manual SSH builds required.
* Push all changes to https://github.com/layonara/nwn-haks Note: <b>64bit branch</b>
* ssh to nwsync-ssl.layonara.com
* <code>cd /home/orth/layo-haks && git pull</code>
* <code>cp layonara.tlk /layonara/nwn/userdir/tlk</code>
* Run <code>layonara_nwn hak --yes</code>
* Run <code>sudo /home/orth/.nimble/bin/nwn_nwsync_write --description="The World of Layonara" /var/www/html-ssl /layonara/nwn/userdir/modules/Layonara_6-00.mod</code> <b>Note: You don't need to upload a new module each time, only if the tlk name changes or the haks used/order changed</b>
* <code>scp l64*.hak orth@116.203.70.169:/layonara/nwn/userdir/hak/</code>
* <code>scp layonara.tlk  orth@116.203.70.169:/layonara/nwn/userdir/tlk/</code>


== New NWN Server Version ==
== Overview ==
* <code>cd /layonara/nwn && wget <NEW_SERVER_ZIP_URL></code>
* <code> unzip <NEW_SERVER_ZIP></code> and overwrite all


== EE64 Server Setup ==
{| class="wikitable"
* Push all changes to https://github.com/layonara/nwn-module Note: <b>ee branch</b>
|-
* ssh to ee64.layonara.com
! Component !! Repo !! Branch !! CI Trigger !! Deploy Method
* <code>cd /layonara/nwn/nwn-module && git pull</code>
|-
* <code>nasher pack core --clean</code> Note: <b>You may need to update the nwserver version first</b>
| NWN Module || [https://github.com/layonara/nwn-module layonara/nwn-module] || <code>ee</code> || Push to <code>ee</code> || Dashboard → Deploy
* <code>mv *.mod /layonara/nwn/userdir/modules/</code>
|-
* Run <code>/layonara/nwn/mod-disable.sh</code>
| Hak Packs || [https://github.com/layonara/nwn-haks layonara/nwn-haks] || <code>64bit</code> || Push to <code>64bit</code> || Dashboard → Deploy (requires Stop first)
* Run <code>/layonara/nwn/mod-stop.sh</code>
|-
* <code>cd /layonara/nwn/nwnx && git pull</code> <b>DON'T DO UNTIL SERVER IS STOPPED</b>
| NWNX (Unified) || [https://github.com/plenarius/unified plenarius/unified] || <code>master</code> || Push to <code>master</code> || Dashboard → Update NWNX
* Rebuild nwnx in /layonara/nwn/nwnx with <code>./Scripts/buildnwnx.sh -j4</code>
|-
* Edit <code>mod-start.sh</code> and change the module version
| Discord Bot || [https://github.com/layonara/discord-bot-aragen discord-bot-aragen] || <code>main</code> || Push to <code>main</code> || Auto-deploy via Coolify
* Remove any temp overrides added to /layonara/nwn/userdir/development
|}
* Run <code>/layonara/nwn/mod-enable.sh</code>
 
* Reboot if desired
== Module Update ==
 
# Create a PR targeting the <code>ee</code> branch on [https://github.com/layonara/nwn-module nwn-module]
# Merge the PR — CI automatically runs <code>stage-module.sh</code> on leanthar, which compiles with nasher and stages the <code>.mod</code> file to ee64's <code>.staged</code> directory
# On the Discord dashboard, click '''Deploy''' → select the staged version from the dropdown → set wait time → confirm
# The bot promotes the staged module to live, updates <code>NWN_MODULE</code> in the environment, and triggers a restart
 
== Hak Pack Update ==
 
'''Note:''' Hak updates require a full server stop because players must re-download via NWSync.
 
# Create a PR targeting the <code>64bit</code> branch on [https://github.com/layonara/nwn-haks nwn-haks]
# Merge the PR — CI runs <code>build.sh</code> and <code>stage-haks.sh</code> on leanthar, which builds haks and stages them to ee64
# On the Discord dashboard, click '''Stop''' to shut down the server (it will NOT auto-restart)
# Click '''Deploy''' to promote staged module + haks to live
# Click '''Restart''' to bring the server back up with new haks
 
== NWNX Update ==
 
NWNX is the C++ plugin framework. Changes to <code>plenarius/unified</code> (including the Layonara plugin) require a Docker image rebuild.
 
# Create a PR targeting <code>master</code> on [https://github.com/plenarius/unified plenarius/unified]
# Merge the PR — CI compiles, builds a Docker image, and pushes to <code>ghcr.io/plenarius/unified:latest</code>
# On the Discord dashboard, click '''Update NWNX''' → it shows running vs latest version → click '''Pull & Restart'''
# The bot pulls the new Docker image on ee64 and triggers a restart
 
== Discord Bot Update ==
 
# Create a PR targeting <code>main</code> on [https://github.com/layonara/discord-bot-aragen discord-bot-aragen]
# Merge the PR — CI builds a Docker image and Coolify automatically restarts the bot container
# No manual action needed
 
== Release / Versioning ==
 
Use the <code>/deploy_confirm</code> Discord command to create a GitHub release:
 
# Run <code>/deploy_preview</code> to see unreleased changelog entries
# Run <code>/deploy_confirm</code> with minor or major bump
# This creates a GitHub tag (<code>vX.Y</code>) on the <code>ee</code> branch, which triggers <code>release-module.yml</code> to build a versioned module
# The bot posts release notes to the changelog channel, SMF forums, wiki, and in-game
# Bug threads in Discord get "Now Live" follow-ups
 
== Dashboard Buttons ==
 
{| class="wikitable"
|-
! Button !! What it does
|-
| '''Deploy''' || Shows a dropdown of the 5 most recent module versions (staged marked). Promotes staged files, sets NWN_MODULE, cleans hotfix overrides, restarts.
|-
| '''Restart''' || Sends in-game countdown then restarts. If server is stopped, starts the container instead.
|-
| '''Stop''' || Sends in-game countdown then stops the container. Server will NOT auto-restart. Use Restart to bring it back.
|-
| '''Update NWNX''' || Compares running vs latest NWNX image. Pull & Restart to upgrade.
|-
| '''Logs''' || Tail the last N lines of the server log.
|-
| '''Refresh''' || Force-refresh the dashboard embed.
|}
 
== Hotfixes ==
 
For emergency single-file fixes without a full module rebuild:
 
# Use the <code>/hotfix</code> Discord command to SCP individual compiled scripts to <code>/opt/layonara/nwserver-docker/server/development/</code> on ee64
# These override module scripts at runtime
# On the next full Deploy, non-persistent hotfix files are automatically cleaned
 
== Infrastructure ==
 
{| class="wikitable"
|-
! Host !! Role !! Address
|-
| leanthar || Build server, bot, wiki, forums || 5.161.122.37 (Hetzner)
|-
| ee64 || Game server, MariaDB, Redis || 10.99.0.3 (via WireGuard)
|-
| Coolify || Service management || https://leanthar.layonara.com
|-
| Grafana || Monitoring || https://grafana.layonara.com
|}
 
Servers connected via WireGuard tunnel (10.99.0.x). Bot reaches ee64 via SSH over the tunnel.