#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 .\get-cameleer.ps1 -Version v1.2.0 #> param( [string]$Version, [string]$Ref, [switch]$Run ) $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.sh' '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 ready in $Dir\" Write-Host 'Run: cd installer; .\install.sh' Write-Host '' if ($Run) { Set-Location $Dir & .\install.sh @args }