RELOAD CONFIGURATION WITHOUT RESTART
This guide shows you how to reload pulled extensions or refresh the trusted
collectives list on a running swamp serve without restarting the process.
Start the server with hot-reload enabled
swamp serve --hot-reloadThe server writes a PID file to .swamp/serve.pid on startup.
Pull the updated extension
swamp extension pull @name/extension --forceUse --force to overwrite the existing bundle if the extension is already
installed.
Trigger the reload
swamp serve reloadThe server reloads all pulled extension bundles and refreshes the trust list. Subsequent requests use the updated code.
Refresh the trusted collectives list
swamp extension trust add @acmeswamp serve reloadThe server re-reads .swamp.yaml and picks up the updated trust list.
Extensions from newly trusted collectives are available for auto-resolution on
subsequent requests.
Reload on a remote server
Pass --server to send the reload request over WebSocket instead of using the
local PID file:
swamp serve reload --server wss://swamp.acme.internal:9090If the server requires authentication, provide a token:
swamp serve reload --server wss://swamp.acme.internal:9090 \
--token 'paul-token.<secret>'To avoid repeating --server on every command, set SWAMP_SERVE_URL:
export SWAMP_SERVE_URL=wss://swamp.acme.internal:9090
swamp serve reloadStored credentials from swamp auth server-login are used automatically.
Related
- Hot Reload — full reference for
the
--hot-reloadflag and reload behavior - Serve Flags — all
swamp serveflags