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:** **Linux / macOS:**
```bash ```bash
curl -fsSL https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.sh | bash bash -c "$(curl -fsSL https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.sh)"
cd installer && ./install.sh
``` ```
**Windows (PowerShell):** **Windows (PowerShell):**
```powershell ```powershell
irm https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.ps1 | iex 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:** **Pin a version:**
```bash ```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 ## Deployment Modes
| | Multi-tenant SaaS | Standalone | | | Multi-tenant SaaS | Standalone |
@@ -216,9 +222,10 @@ All services share a single hostname. Routing:
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `get-cameleer.sh` | Bootstrap script (bash) — downloads installer files | | `get-cameleer.sh` | Bootstrap script (bash) — downloads installer files and launches `install.sh` |
| `get-cameleer.ps1` | Bootstrap script (PowerShell) — downloads installer files | | `get-cameleer.ps1` | Bootstrap script (PowerShell) — downloads installer files and launches `install.ps1` |
| `install.sh` | Main installer — interactive or silent deployment | | `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.yml` | Base infrastructure (Traefik, PostgreSQL, ClickHouse) |
| `templates/docker-compose.saas.yml` | SaaS mode (Logto + management plane) | | `templates/docker-compose.saas.yml` | SaaS mode (Logto + management plane) |
| `templates/docker-compose.server.yml` | Standalone mode (server + UI) | | `templates/docker-compose.server.yml` | Standalone mode (server + UI) |

View File

@@ -4,12 +4,13 @@
Bootstrap script — downloads the Cameleer installer and runs it. Bootstrap script — downloads the Cameleer installer and runs it.
.EXAMPLE .EXAMPLE
irm https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw/branch/main/get-cameleer.ps1 | iex 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( param(
[string]$Version, [string]$Version,
[string]$Ref, [string]$Ref,
[switch]$Run [Parameter(ValueFromRemainingArguments = $true)]
[string[]]$InstallerArgs
) )
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
@@ -23,7 +24,7 @@ $Base = "$Repo/$RefPath"
$Dir = '.\installer' $Dir = '.\installer'
$Files = @( $Files = @(
'install.sh' 'install.ps1'
'templates/docker-compose.yml' 'templates/docker-compose.yml'
'templates/docker-compose.saas.yml' 'templates/docker-compose.saas.yml'
'templates/docker-compose.server.yml' 'templates/docker-compose.server.yml'
@@ -47,11 +48,13 @@ foreach ($file in $Files) {
} }
Write-Host '' Write-Host ''
Write-Host "Installer ready in $Dir\" Write-Host "Installer downloaded to $Dir\ — launching..."
Write-Host 'Run: cd installer; .\install.sh'
Write-Host '' Write-Host ''
if ($Run) { Set-Location $Dir
Set-Location $Dir if ($InstallerArgs) {
& .\install.sh @args & .\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. # Bootstrap script — downloads the Cameleer installer and runs it.
# Usage: # Usage:
# curl -fsSL https://get.cameleer.io/install | bash # bash -c "$(curl -fsSL https://get.cameleer.io/install)"
# curl -fsSL https://get.cameleer.io/install | bash -s -- --version v1.2.0 # bash -c "$(curl -fsSL https://get.cameleer.io/install)" -- --version v1.2.0
REPO="https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw" REPO="https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw"
REF="branch/main" REF="branch/main"
DIR="./installer" DIR="./installer"
# Parse --version / --ref # Parse --version / --ref (consume them; remaining args are forwarded to install.sh)
PASS_ARGS=()
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in
--version=*) REF="tag/${arg#*=}"; shift ;; --version=*) REF="tag/${arg#*=}" ;;
--ref=*) REF="branch/${arg#*=}"; shift ;; --ref=*) REF="branch/${arg#*=}" ;;
*) PASS_ARGS+=("$arg") ;;
esac esac
done done
@@ -43,13 +45,8 @@ done
chmod +x "$DIR/install.sh" chmod +x "$DIR/install.sh"
echo "" echo ""
echo "Installer ready in $DIR/" echo "Installer downloaded to $DIR/ — launching..."
echo "Run: cd $DIR && ./install.sh"
echo "" echo ""
# Auto-run if not piped with extra args that look like they want manual control cd "$DIR"
if [ "${1:-}" = "--run" ]; then exec ./install.sh "${PASS_ARGS[@]}"
shift
cd "$DIR"
exec ./install.sh "$@"
fi