Add server update script and git-based update instructions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
178d2d00ab
commit
7b4239544c
@ -11,6 +11,17 @@ Self-hosted [Supabase](https://supabase.com/docs/guides/self-hosting/docker) in
|
||||
| Studio | Admin dashboard in the browser (password protected) |
|
||||
| Caddy | HTTPS with automatic Let's Encrypt certificates |
|
||||
|
||||
## Updating the live server
|
||||
|
||||
The code lives at https://git.metatroncube.in/MetatroncubeSoftwareSolutions/nkbmusic and the server runs from a clone of it in `~/APPS/nanga_kathai`. After pushing changes:
|
||||
|
||||
```sh
|
||||
ssh dev@72.62.169.43
|
||||
sh ~/APPS/nanga_kathai/server/update.sh
|
||||
```
|
||||
|
||||
That pulls the latest code, applies new migrations and config, and restarts what changed. Passwords, keys and songs are kept.
|
||||
|
||||
## Quick deploy (one command)
|
||||
|
||||
On a fresh Ubuntu server, once the DNS A record for `app.nkbmusic.com` points at it:
|
||||
|
||||
18
server/update.sh
Normal file
18
server/update.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Pull the latest code from git and redeploy the backend (new migrations,
|
||||
# config, email templates). Secrets and data are kept.
|
||||
#
|
||||
# sh ~/APPS/nanga_kathai/server/update.sh
|
||||
#
|
||||
# Settings below match the HestiaCP server; override with env vars if needed.
|
||||
set -eu
|
||||
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
DOMAIN="${NK_DOMAIN:-app.nkbmusic.com}"
|
||||
export NK_DIR="${NK_DIR:-$HOME/APPS/nk-backend}"
|
||||
|
||||
echo "==> Pulling the latest code"
|
||||
git -C "$HERE/.." pull --ff-only
|
||||
git -C "$HERE/.." log --oneline -1
|
||||
|
||||
sh "$HERE/deploy.sh" "$DOMAIN" </dev/null
|
||||
Loading…
x
Reference in New Issue
Block a user