ScuttleBot

scuttlebot / deploy / standalone / install.sh
Blame History Raw 56 lines
1
#!/usr/bin/env bash
2
# install.sh — scuttlebot standalone installer
3
# Usage: curl -fsSL https://scuttlebot.dev/install.sh | bash
4
# or: bash install.sh [--version v0.1.0] [--dir /usr/local/bin]
5
set -euo pipefail
6
7
REPO="ConflictHQ/scuttlebot"
8
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
9
VERSION="${VERSION:-}"
10
11
# Parse flags.
12
while [[ $# -gt 0 ]]; do
13
case "$1" in
14
--version) VERSION="$2"; shift 2 ;;
15
--dir) INSTALL_DIR="$2"; shift 2 ;;
16
*) echo "Unknown option: $1" >&2; exit 1 ;;
17
esac
18
done
19
20
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
21
ARCH=$(uname -m)
22
case "$ARCH" in
23
x86_64) ARCH="x86_64" ;;
24
aarch64|arm64) ARCH="arm64" ;;
25
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
26
esac
27
28
# Fetch latest version if not specified.
29
if [[ -z "$VERSION" ]]; then
30
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
31
| grep '"tag_name"' | sed 's/.*"tag_name": "\(.*\)".*/\1/')
32
fi
33
34
ASSET="scuttlebot-${VERSION}-${OS}-${ARCH}.tar.gz"
35
URL="https://github.com/${REPO}/releases/download/${VERSION}/${ASSET}"
36
37
echo "Installing scuttlebot ${VERSION} for ${OS}/${ARCH}..."
38
echo "Downloading ${URL}"
39
40
TMP=$(mktemp -d)
41
trap 'rm -rf "$TMP"' EXIT
42
43
curl -fsSL "$URL" -o "${TMP}/${ASSET}"
44
tar -xzf "${TMP}/${ASSET}" -C "$TMP"
45
46
install -m 755 "${TMP}/scuttlebot" "${INSTALL_DIR}/scuttlebot"
47
48
echo ""
49
echo "scuttlebot ${VERSION} installed to ${INSTALL_DIR}/scuttlebot"
50
echo ""
51
echo "Quick start:"
52
echo " scuttlebot # boots ergo + daemon, auto-downloads ergo on first run"
53
echo " scuttlebot --config /path/to/scuttlebot.yaml"
54
echo ""
55
echo "See: https://scuttlebot.dev/docs/deployment/standalone"
56

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button