Clean up: remove build-for-nas.sh, update deploy docs and push script
Build and Push Image / build (push) Has been cancelled
Build and Push Image / build (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-4
@@ -104,7 +104,8 @@ Then the NAS only needs to pull the image; no build on the NAS.
|
|||||||
|
|
||||||
The repo’s Gitea Actions build the image and push it to the Gitea registry. Use this image on your NAS so you always run the latest build.
|
The repo’s Gitea Actions build the image and push it to the Gitea registry. Use this image on your NAS so you always run the latest build.
|
||||||
|
|
||||||
**Image:** `brassnet.ddns.net:33983/Dawnsorrow/stoat-role-bot:latest`
|
**Image:** `brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest`
|
||||||
|
(Registry image names are lowercase; use `dawnsorrow`.)
|
||||||
|
|
||||||
### On the NAS (so the image appears in your Docker app)
|
### On the NAS (so the image appears in your Docker app)
|
||||||
|
|
||||||
@@ -130,10 +131,10 @@ The repo’s Gitea Actions build the image and push it to the Gitea registry. Us
|
|||||||
|
|
||||||
3. **Pull the image**
|
3. **Pull the image**
|
||||||
- In the UI: use “Pull image” (or similar) and enter:
|
- In the UI: use “Pull image” (or similar) and enter:
|
||||||
`brassnet.ddns.net:33983/Dawnsorrow/stoat-role-bot:latest`
|
`brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest`
|
||||||
- Or via SSH:
|
- Or via SSH:
|
||||||
```bash
|
```bash
|
||||||
docker pull brassnet.ddns.net:33983/Dawnsorrow/stoat-role-bot:latest
|
docker pull brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Create and run the container**
|
4. **Create and run the container**
|
||||||
@@ -144,7 +145,7 @@ The repo’s Gitea Actions build the image and push it to the Gitea registry. Us
|
|||||||
- **Volume**: host folder with `roles.json` → `/app/config`
|
- **Volume**: host folder with `roles.json` → `/app/config`
|
||||||
|
|
||||||
5. **Updates**
|
5. **Updates**
|
||||||
To get the newest version: pull again (`docker pull brassnet.ddns.net:33983/Dawnsorrow/stoat-role-bot:latest` or “Pull” in the UI), then recreate or restart the container.
|
To get the newest version: pull again (`docker pull brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest` or “Pull” in the UI), then recreate or restart the container.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build Stoat Role Bot image and save to a .tar for upload to NAS.
|
|
||||||
# Run this on a machine with Docker installed (e.g. your PC).
|
|
||||||
|
|
||||||
set -e
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
|
|
||||||
echo "Building Docker image..."
|
|
||||||
docker build -t stoat-role-bot:latest .
|
|
||||||
|
|
||||||
echo "Saving image to stoat-role-bot.tar..."
|
|
||||||
docker save stoat-role-bot:latest -o stoat-role-bot.tar
|
|
||||||
|
|
||||||
echo "Done. Upload these to your NAS:"
|
|
||||||
echo " 1. stoat-role-bot.tar (the image)"
|
|
||||||
echo " 2. config/ folder with roles.json (your server ID + message ID)"
|
|
||||||
echo ""
|
|
||||||
echo "Then on the NAS: load the image and create a container with:"
|
|
||||||
echo " - Env: STOAT_BOT_TOKEN, PREFIX=!, CONFIG_PATH=/app/config"
|
|
||||||
echo " - Volume: host path with roles.json -> /app/config"
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
rolebot:
|
rolebot:
|
||||||
image: ${GITEA_IMAGE:-gitea.example.com/username/stoat-role-bot:latest}
|
image: ${GITEA_IMAGE:-brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest}
|
||||||
container_name: stoat-role-bot
|
container_name: stoat-role-bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
+25
-8
@@ -137,6 +137,17 @@ Example: if your Gitea URL is `https://git.myserver.com` and your username is `j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## If you see “No matching online runner with label: ubuntu-latest”
|
||||||
|
|
||||||
|
Gitea **does not** provide hosted runners like GitHub. The workflow only runs if a **self-hosted runner** is registered with your Gitea instance and has the label `ubuntu-latest`.
|
||||||
|
|
||||||
|
**Options:**
|
||||||
|
|
||||||
|
1. **Use the manual build and push** (no runner needed): see **“If Gitea Actions aren’t available: manual push”** below. Run `./push-to-gitea.sh` from your PC after a one-time `podman login brassnet.ddns.net:33983`.
|
||||||
|
2. **Set up a self-hosted runner**: in Gitea go to **Settings → Actions → Runners**, add a new runner on a machine that has Docker, and give it the label `ubuntu-latest` so the workflow can use it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Part 6: Use that image on your NAS
|
## Part 6: Use that image on your NAS
|
||||||
|
|
||||||
1. On the NAS, create a folder for the bot (e.g. `stoat-role-bot`) and put there:
|
1. On the NAS, create a folder for the bot (e.g. `stoat-role-bot`) and put there:
|
||||||
@@ -158,25 +169,31 @@ If your Gitea is only reachable on your LAN, the NAS must be able to reach that
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## If Gitea Actions aren’t available: manual push
|
## If Gitea Actions aren’t available (or “No matching runner”): manual push
|
||||||
|
|
||||||
You can build and push the image from your PC instead of using Actions:
|
You can build and push the image from your PC instead of using Actions:
|
||||||
|
|
||||||
1. Install Podman (or Docker) and log in to Gitea’s registry:
|
1. **Allow HTTP registry** (if your Gitea is `http://`). One-time, on your PC:
|
||||||
```bash
|
```bash
|
||||||
podman login git.myserver.com
|
mkdir -p ~/.config/containers
|
||||||
|
printf '%s\n' '[[registry]]' 'location = "brassnet.ddns.net:33983"' 'insecure = true' > ~/.config/containers/registries.conf
|
||||||
|
```
|
||||||
|
(If you already have a `registries.conf`, add the `[[registry]]` block for `brassnet.ddns.net:33983` instead of overwriting.)
|
||||||
|
|
||||||
|
2. **Log in to the registry** (one-time per machine):
|
||||||
|
```bash
|
||||||
|
podman login brassnet.ddns.net:33983
|
||||||
```
|
```
|
||||||
Use your Gitea username and password (or token).
|
Use your Gitea username and password (or token).
|
||||||
|
|
||||||
2. From the bot project folder:
|
3. **Build and push** from the bot project folder:
|
||||||
```bash
|
```bash
|
||||||
export GITEA_REGISTRY=git.myserver.com
|
cd "/path/to/Role Bot"
|
||||||
export GITEA_OWNER=jorg
|
|
||||||
./push-to-gitea.sh
|
./push-to-gitea.sh
|
||||||
```
|
```
|
||||||
Replace `git.myserver.com` and `jorg` with your Gitea host and username.
|
Defaults are `brassnet.ddns.net:33983` and `Dawnsorrow`; the script lowercases the owner for the image name (e.g. `dawnsorrow/stoat-role-bot:latest`).
|
||||||
|
|
||||||
3. On the NAS, use the same image name as above and run the same `docker compose -f docker-compose.pull.yml` commands.
|
4. On the NAS, use image **`brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest`** (lowercase `dawnsorrow`) and run the same `docker compose -f docker-compose.pull.yml` commands.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+16
-15
@@ -1,31 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Manual push of stoat-role-bot image to your Gitea container registry.
|
# Build and push stoat-role-bot image to your Gitea container registry.
|
||||||
|
# Image names must be lowercase; owner is lowercased automatically.
|
||||||
|
#
|
||||||
|
# One-time: allow HTTP registry (if your Gitea is http://):
|
||||||
|
# mkdir -p ~/.config/containers
|
||||||
|
# echo -e '[[registry]]\nlocation = "brassnet.ddns.net:33983"\ninsecure = true' >> ~/.config/containers/registries.conf
|
||||||
|
# One-time: log in to the registry:
|
||||||
|
# podman login brassnet.ddns.net:33983
|
||||||
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# export GITEA_REGISTRY=mygitea.example.com
|
|
||||||
# export GITEA_OWNER=myuser
|
|
||||||
# ./push-to-gitea.sh
|
# ./push-to-gitea.sh
|
||||||
# Or: ./push-to-gitea.sh mygitea.example.com myuser
|
# # or: ./push-to-gitea.sh brassnet.ddns.net:33983 Dawnsorrow
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
GITEA_REGISTRY="${1:-$GITEA_REGISTRY}"
|
GITEA_REGISTRY="${1:-brassnet.ddns.net:33983}"
|
||||||
GITEA_OWNER="${2:-$GITEA_OWNER}"
|
GITEA_OWNER="${2:-Dawnsorrow}"
|
||||||
|
# OCI image names must be lowercase
|
||||||
|
OWNER_LOWER="$(echo "$GITEA_OWNER" | tr '[:upper:]' '[:lower:]')"
|
||||||
IMAGE_NAME="stoat-role-bot"
|
IMAGE_NAME="stoat-role-bot"
|
||||||
TAG="${3:-latest}"
|
TAG="${3:-latest}"
|
||||||
|
|
||||||
if [ -z "$GITEA_REGISTRY" ] || [ -z "$GITEA_OWNER" ]; then
|
FULL_IMAGE="${GITEA_REGISTRY}/${OWNER_LOWER}/${IMAGE_NAME}:${TAG}"
|
||||||
echo "Usage: GITEA_REGISTRY=host GITEA_OWNER=username $0"
|
|
||||||
echo " or: $0 <gitea-host> <owner-username> [tag]"
|
|
||||||
echo "Example: $0 gitea.example.com john"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FULL_IMAGE="${GITEA_REGISTRY}/${GITEA_OWNER}/${IMAGE_NAME}:${TAG}"
|
|
||||||
echo "Building and pushing to ${FULL_IMAGE} ..."
|
echo "Building and pushing to ${FULL_IMAGE} ..."
|
||||||
|
|
||||||
podman build -t "${FULL_IMAGE}" .
|
podman build -t "${FULL_IMAGE}" .
|
||||||
podman push "${FULL_IMAGE}"
|
podman push "${FULL_IMAGE}"
|
||||||
|
|
||||||
echo "Pushed. On your NAS run: docker pull ${FULL_IMAGE}"
|
echo "Pushed. On your NAS: docker pull ${FULL_IMAGE}"
|
||||||
echo "Then create/update the container to use image: ${FULL_IMAGE}"
|
echo "Then create/update the container to use image: ${FULL_IMAGE}"
|
||||||
|
|||||||
Reference in New Issue
Block a user