39 lines
1.3 KiB
PowerShell
39 lines
1.3 KiB
PowerShell
# Mosaic Bootstrap — Remote Installer (Windows PowerShell)
|
|
#
|
|
# One-liner:
|
|
# irm https://git.mosaicstack.dev/mosaic/bootstrap/raw/branch/main/remote-install.ps1 | iex
|
|
#
|
|
# Or explicit:
|
|
# powershell -ExecutionPolicy Bypass -File remote-install.ps1
|
|
#
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$BootstrapRef = if ($env:MOSAIC_BOOTSTRAP_REF) { $env:MOSAIC_BOOTSTRAP_REF } else { "main" }
|
|
$ArchiveUrl = "https://git.mosaicstack.dev/mosaic/bootstrap/archive/$BootstrapRef.zip"
|
|
$WorkDir = Join-Path $env:TEMP "mosaic-bootstrap-$PID"
|
|
$ZipPath = "$WorkDir.zip"
|
|
|
|
try {
|
|
Write-Host "[mosaic] Downloading bootstrap archive (ref: $BootstrapRef)..."
|
|
New-Item -ItemType Directory -Path $WorkDir -Force | Out-Null
|
|
Invoke-WebRequest -Uri $ArchiveUrl -OutFile $ZipPath -UseBasicParsing
|
|
|
|
Write-Host "[mosaic] Extracting..."
|
|
Expand-Archive -Path $ZipPath -DestinationPath $WorkDir -Force
|
|
|
|
$InstallScript = Join-Path $WorkDir "bootstrap\install.ps1"
|
|
if (-not (Test-Path $InstallScript)) {
|
|
throw "install.ps1 not found in archive"
|
|
}
|
|
|
|
Write-Host "[mosaic] Running install..."
|
|
& $InstallScript
|
|
|
|
Write-Host "[mosaic] Done."
|
|
}
|
|
finally {
|
|
Write-Host "[mosaic] Cleaning up temporary files..."
|
|
Remove-Item -Path $ZipPath -Force -ErrorAction SilentlyContinue
|
|
Remove-Item -Path $WorkDir -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|