feat: bootstrap scripts auto-launch the installer

get-cameleer.sh and get-cameleer.ps1 now download the installer files
and exec install.sh / install.ps1 immediately instead of just printing
a "run this next" hint. Extra arguments are forwarded to the installer.

PowerShell bootstrap fetches install.ps1 (not install.sh) so Windows
users no longer need bash. README updated to use the bash -c "$(curl ...)"
form so install.sh's interactive prompts inherit the user's TTY.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-25 15:35:32 +02:00
parent 528c6d1980
commit 0b092065c5
3 changed files with 35 additions and 28 deletions

View File

@@ -7,23 +7,29 @@ One-line installer for the [Cameleer](https://cameleer.io) observability platfor
**Linux / macOS:**
```bash
curl -fsSL https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.sh | bash
cd installer && ./install.sh
bash -c "$(curl -fsSL https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.sh)"
```
**Windows (PowerShell):**
```powershell
irm https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.ps1 | iex
cd installer; .\install.sh
```
The bootstrap downloads the installer into `./installer/` and launches it immediately. The interactive prompts run in your terminal.
**Pin a version:**
```bash
curl -fsSL .../get-cameleer.sh | bash -s -- --version=v1.0.0
bash -c "$(curl -fsSL .../get-cameleer.sh)" -- --version=v1.0.0
```
```powershell
& ([scriptblock]::Create((irm .../get-cameleer.ps1))) -Version v1.0.0
```
Any extra arguments are forwarded to `install.sh` / `install.ps1` (e.g. `--silent`, `--expert`, `--public-host=…`).
## Deployment Modes
| | Multi-tenant SaaS | Standalone |
@@ -216,9 +222,10 @@ All services share a single hostname. Routing:
| File | Purpose |
|------|---------|
| `get-cameleer.sh` | Bootstrap script (bash) — downloads installer files |
| `get-cameleer.ps1` | Bootstrap script (PowerShell) — downloads installer files |
| `install.sh` | Main installer — interactive or silent deployment |
| `get-cameleer.sh` | Bootstrap script (bash) — downloads installer files and launches `install.sh` |
| `get-cameleer.ps1` | Bootstrap script (PowerShell) — downloads installer files and launches `install.ps1` |
| `install.sh` | Main installer (Linux / macOS) — interactive or silent deployment |
| `install.ps1` | Main installer (Windows PowerShell) — interactive or silent deployment |
| `templates/docker-compose.yml` | Base infrastructure (Traefik, PostgreSQL, ClickHouse) |
| `templates/docker-compose.saas.yml` | SaaS mode (Logto + management plane) |
| `templates/docker-compose.server.yml` | Standalone mode (server + UI) |

View File

@@ -4,12 +4,13 @@
Bootstrap script — downloads the Cameleer installer and runs it.
.EXAMPLE
irm https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.ps1 | iex
.\get-cameleer.ps1 -Version v1.2.0
& ([scriptblock]::Create((irm https://.../get-cameleer.ps1))) -Version v1.2.0
#>
param(
[string]$Version,
[string]$Ref,
[switch]$Run
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$InstallerArgs
)
$ErrorActionPreference = 'Stop'
@@ -23,7 +24,7 @@ $Base = "$Repo/$RefPath"
$Dir = '.\installer'
$Files = @(
'install.sh'
'install.ps1'
'templates/docker-compose.yml'
'templates/docker-compose.saas.yml'
'templates/docker-compose.server.yml'
@@ -47,11 +48,13 @@ foreach ($file in $Files) {
}
Write-Host ''
Write-Host "Installer ready in $Dir\"
Write-Host 'Run: cd installer; .\install.sh'
Write-Host "Installer downloaded to $Dir\ — launching..."
Write-Host ''
if ($Run) {
Set-Location $Dir
& .\install.sh @args
Set-Location $Dir
if ($InstallerArgs) {
& .\install.ps1 @InstallerArgs
} else {
& .\install.ps1
}
exit $LASTEXITCODE

View File

@@ -3,18 +3,20 @@ set -euo pipefail
# Bootstrap script — downloads the Cameleer installer and runs it.
# Usage:
# curl -fsSL https://get.cameleer.io/install | bash
# curl -fsSL https://get.cameleer.io/install | bash -s -- --version v1.2.0
# bash -c "$(curl -fsSL https://get.cameleer.io/install)"
# bash -c "$(curl -fsSL https://get.cameleer.io/install)" -- --version v1.2.0
REPO="https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw"
REF="branch/main"
DIR="./installer"
# Parse --version / --ref
# Parse --version / --ref (consume them; remaining args are forwarded to install.sh)
PASS_ARGS=()
for arg in "$@"; do
case "$arg" in
--version=*) REF="tag/${arg#*=}"; shift ;;
--ref=*) REF="branch/${arg#*=}"; shift ;;
--version=*) REF="tag/${arg#*=}" ;;
--ref=*) REF="branch/${arg#*=}" ;;
*) PASS_ARGS+=("$arg") ;;
esac
done
@@ -43,13 +45,8 @@ done
chmod +x "$DIR/install.sh"
echo ""
echo "Installer ready in $DIR/"
echo "Run: cd $DIR && ./install.sh"
echo "Installer downloaded to $DIR/ — launching..."
echo ""
# Auto-run if not piped with extra args that look like they want manual control
if [ "${1:-}" = "--run" ]; then
shift
cd "$DIR"
exec ./install.sh "$@"
fi
cd "$DIR"
exec ./install.sh "${PASS_ARGS[@]}"