Files
cameleer-saas-installer/get-cameleer.ps1
hsiegeln 0b092065c5 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>
2026-04-25 15:35:32 +02:00

61 lines
1.6 KiB
PowerShell

#Requires -Version 5.1
<#
.SYNOPSIS
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
& ([scriptblock]::Create((irm https://.../get-cameleer.ps1))) -Version v1.2.0
#>
param(
[string]$Version,
[string]$Ref,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$InstallerArgs
)
$ErrorActionPreference = 'Stop'
$Repo = 'https://registry.cameleer.io/cameleer/cameleer-saas-installer/raw'
if ($Version) { $RefPath = "tag/$Version" }
elseif ($Ref) { $RefPath = "branch/$Ref" }
else { $RefPath = 'branch/main' }
$Base = "$Repo/$RefPath"
$Dir = '.\installer'
$Files = @(
'install.ps1'
'templates/docker-compose.yml'
'templates/docker-compose.saas.yml'
'templates/docker-compose.server.yml'
'templates/docker-compose.tls.yml'
'templates/docker-compose.monitoring.yml'
'templates/traefik-dynamic.yml'
'templates/.env.example'
)
Write-Host 'Downloading Cameleer installer...'
New-Item -ItemType Directory -Path "$Dir\templates" -Force | Out-Null
foreach ($file in $Files) {
$localPath = Join-Path $Dir $file
$localDir = Split-Path $localPath -Parent
if (-not (Test-Path $localDir)) { New-Item -ItemType Directory -Path $localDir -Force | Out-Null }
Write-Host " $file"
Invoke-WebRequest -Uri "$Base/$file" -OutFile $localPath -UseBasicParsing
}
Write-Host ''
Write-Host "Installer downloaded to $Dir\ — launching..."
Write-Host ''
Set-Location $Dir
if ($InstallerArgs) {
& .\install.ps1 @InstallerArgs
} else {
& .\install.ps1
}
exit $LASTEXITCODE