automa/install.sh
m1ngsama 3433516287 refactor: restructure as self-contained project dirs with interactive CLI
- Remove old services/, bin/, config.sh, Makefile, setup.sh
- Each Docker Compose project is now a top-level self-contained directory
  with compose.yaml + .env.example (project self-governance)
- Add automa CLI: interactive deploy, status, logs, stop, update, config
- Add install.sh for curl-pipe-bash quick start
- New projects from production: uptime-kuma, tailscale+derp, monitoring
  (prometheus+grafana+blackbox+node-exporter), filesuite (cloudreve+qbt),
  huajibot, dockge, notification-center
- Clean up existing projects: forgejo, minecraft, teamspeak, nextcloud
- Sanitize all .env.example files (no real secrets)
2026-04-15 09:54:23 +08:00

54 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# automa installer
# Usage: curl -fsSL https://raw.githubusercontent.com/m1ngsama/automa/main/install.sh | bash
set -euo pipefail
REPO="https://github.com/m1ngsama/automa.git"
INSTALL_DIR="${AUTOMA_DIR:-$HOME/automa}"
RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
BOLD='\033[1m'
DIM='\033[2m'
NC='\033[0m'
info() { echo -e "${GREEN}[+]${NC} $*"; }
error() { echo -e "${RED}[-]${NC} $*" >&2; }
echo ""
echo -e "${CYAN}${BOLD} automa installer${NC}"
echo ""
# Check prerequisites
for cmd in git docker; do
if ! command -v "$cmd" &>/dev/null; then
error "$cmd is required but not installed."
exit 1
fi
done
if ! docker compose version &>/dev/null 2>&1; then
error "docker compose plugin is required."
error "Install: https://docs.docker.com/compose/install/"
exit 1
fi
# Clone or update
if [[ -d "$INSTALL_DIR/.git" ]]; then
info "Updating existing installation..."
git -C "$INSTALL_DIR" pull --ff-only
else
info "Cloning automa to ${INSTALL_DIR}..."
git clone "$REPO" "$INSTALL_DIR"
fi
chmod +x "$INSTALL_DIR/automa"
echo ""
info "Installed to ${INSTALL_DIR}"
echo ""
echo -e " ${BOLD}Next steps:${NC}"
echo -e " cd ${INSTALL_DIR}"
echo -e " ./automa deploy"
echo ""