generated from CubeCraftLabs/Tracehound
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6d812cca2 | |||
| d2222d4947 |
@@ -9,6 +9,9 @@ import { createHash } from 'node:crypto';
|
||||
|
||||
const { TOKEN, SERVER, REPO, SHA } = process.env;
|
||||
const BIN = 'remoterig';
|
||||
// Rolling release tag. NOT "dev" — that would collide with the dev branch
|
||||
// and make refs ambiguous (git push/checkout dev breaks).
|
||||
const TAG = 'dev-latest';
|
||||
const VERSION = SHA.slice(0, 8);
|
||||
const API = `${SERVER}/api/v1/repos/${REPO}`;
|
||||
const H = { Authorization: `token ${TOKEN}` };
|
||||
@@ -27,21 +30,21 @@ const files = {
|
||||
'version.txt': Buffer.from(VERSION + '\n'),
|
||||
};
|
||||
|
||||
// Roll the "dev" release forward to this commit: delete the old release + tag.
|
||||
const existing = await fetch(`${API}/releases/tags/dev`, { headers: H });
|
||||
// Roll the release forward to this commit: delete the old release + tag.
|
||||
const existing = await fetch(`${API}/releases/tags/${TAG}`, { headers: H });
|
||||
if (existing.ok) {
|
||||
const rel = await existing.json();
|
||||
await fetch(`${API}/releases/${rel.id}`, { method: 'DELETE', headers: H });
|
||||
}
|
||||
await fetch(`${API}/tags/dev`, { method: 'DELETE', headers: H }); // ignore if absent
|
||||
await fetch(`${API}/tags/${TAG}`, { method: 'DELETE', headers: H }); // ignore if absent
|
||||
|
||||
const rel = await ok(await fetch(`${API}/releases`, {
|
||||
method: 'POST',
|
||||
headers: { ...H, 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
tag_name: 'dev',
|
||||
tag_name: TAG,
|
||||
target_commitish: SHA,
|
||||
name: `dev (${VERSION})`,
|
||||
name: `${TAG} (${VERSION})`,
|
||||
body: `Rolling dev build ${SHA}`,
|
||||
prerelease: true,
|
||||
}),
|
||||
|
||||
@@ -24,7 +24,7 @@ REPO="${REPO:-CubeCraft-Creations/remote-rig}"
|
||||
DEPLOY_DIR="/opt/remoterig"
|
||||
DEPLOY_PATH="${DEPLOY_PATH:-$DEPLOY_DIR/remoterig}"
|
||||
SERVICE="${SERVICE:-remoterig}"
|
||||
TAG="dev"
|
||||
TAG="dev-latest"
|
||||
DL="$GITEA_BASE/$REPO/releases/download/$TAG"
|
||||
VERSION_FILE="$DEPLOY_DIR/VERSION"
|
||||
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
#
|
||||
# Options:
|
||||
# --config PATH Path to config.yaml template to copy to /opt/remoterig/
|
||||
# --service-user USER Systemd service user (default: pi)
|
||||
# --service-user USER Systemd service user (default: invoking sudo user, else pi)
|
||||
# --static-ip IP Static IP for wlan0 (default: 192.168.8.56/24)
|
||||
# --gateway IP Gateway for wlan0 (default: 192.168.8.1)
|
||||
# --help Show this help
|
||||
@@ -19,7 +19,7 @@ set -euo pipefail
|
||||
# Defaults
|
||||
# ---------------------------------------------------------------------------
|
||||
CONFIG_TEMPLATE=""
|
||||
SERVICE_USER="pi"
|
||||
SERVICE_USER="${SUDO_USER:-pi}" # default to the invoking user (not every Pi has a 'pi' user)
|
||||
STATIC_IP="192.168.8.56/24"
|
||||
GATEWAY="192.168.8.1"
|
||||
MOSQUITTO_PKG="mosquitto mosquitto-clients"
|
||||
|
||||
Reference in New Issue
Block a user