m (Complete rewrite for automated CI/CD deployment flow)
 
(One intermediate revision by the same user not shown)
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>
|-
* <code>cd /layonara/nwn/nwnx && git pull</code> <b>DON'T DO UNTIL SERVER IS STOPPED</b>
| Hak Packs || [https://github.com/layonara/nwn-haks layonara/nwn-haks] || <code>64bit</code> || Push to <code>64bit</code> || Dashboard → Deploy (requires Stop first)
* Rebuild nwnx in /layonara/nwn/nwnx with <code>./Scripts/buildnwnx.sh -j4</code>
|-
* Run <code>/layonara/nwn/mod-disable.sh</code>
| NWNX (Unified) || [https://github.com/plenarius/unified plenarius/unified] || <code>master</code> || Push to <code>master</code> || Dashboard → Update NWNX
* Run <code>/layonara/nwn/mod-stop.sh</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.

Latest revision as of 23:14, 17 April 2026

All deployments are managed through GitHub PRs, CI pipelines, and the Discord dashboard. No manual SSH builds required.

Overview

Component Repo Branch CI Trigger Deploy Method
NWN Module layonara/nwn-module ee Push to ee Dashboard → Deploy
Hak Packs layonara/nwn-haks 64bit Push to 64bit Dashboard → Deploy (requires Stop first)
NWNX (Unified) plenarius/unified master Push to master Dashboard → Update NWNX
Discord Bot discord-bot-aragen main Push to main Auto-deploy via Coolify

Module Update

  1. Create a PR targeting the ee branch on nwn-module
  2. Merge the PR — CI automatically runs stage-module.sh on leanthar, which compiles with nasher and stages the .mod file to ee64's .staged directory
  3. On the Discord dashboard, click Deploy → select the staged version from the dropdown → set wait time → confirm
  4. The bot promotes the staged module to live, updates NWN_MODULE 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.

  1. Create a PR targeting the 64bit branch on nwn-haks
  2. Merge the PR — CI runs build.sh and stage-haks.sh on leanthar, which builds haks and stages them to ee64
  3. On the Discord dashboard, click Stop to shut down the server (it will NOT auto-restart)
  4. Click Deploy to promote staged module + haks to live
  5. Click Restart to bring the server back up with new haks

NWNX Update

NWNX is the C++ plugin framework. Changes to plenarius/unified (including the Layonara plugin) require a Docker image rebuild.

  1. Create a PR targeting master on plenarius/unified
  2. Merge the PR — CI compiles, builds a Docker image, and pushes to ghcr.io/plenarius/unified:latest
  3. On the Discord dashboard, click Update NWNX → it shows running vs latest version → click Pull & Restart
  4. The bot pulls the new Docker image on ee64 and triggers a restart

Discord Bot Update

  1. Create a PR targeting main on discord-bot-aragen
  2. Merge the PR — CI builds a Docker image and Coolify automatically restarts the bot container
  3. No manual action needed

Release / Versioning

Use the /deploy_confirm Discord command to create a GitHub release:

  1. Run /deploy_preview to see unreleased changelog entries
  2. Run /deploy_confirm with minor or major bump
  3. This creates a GitHub tag (vX.Y) on the ee branch, which triggers release-module.yml to build a versioned module
  4. The bot posts release notes to the changelog channel, SMF forums, wiki, and in-game
  5. Bug threads in Discord get "Now Live" follow-ups

Dashboard Buttons

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:

  1. Use the /hotfix Discord command to SCP individual compiled scripts to /opt/layonara/nwserver-docker/server/development/ on ee64
  2. These override module scripts at runtime
  3. On the next full Deploy, non-persistent hotfix files are automatically cleaned

Infrastructure

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.