From cafd7e93693903847a092694661a32aa59b65e4e Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:48:23 +0200 Subject: [PATCH] feat: add bootstrap scripts for one-line installer download get-cameleer.sh and get-cameleer.ps1 download just the installer files from Gitea into a local ./installer directory. Usage: curl -fsSL https://gitea.siegeln.net/.../get-cameleer.sh | bash irm https://gitea.siegeln.net/.../get-cameleer.ps1 | iex Supports --version=v1.2.0 to pin a specific tag, defaults to main. Pass --run to auto-execute the installer after download. Co-Authored-By: Claude Opus 4.6 (1M context) --- get-cameleer.ps1 | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ get-cameleer.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 get-cameleer.ps1 create mode 100644 get-cameleer.sh diff --git a/get-cameleer.ps1 b/get-cameleer.ps1 new file mode 100644 index 0000000..669aa61 --- /dev/null +++ b/get-cameleer.ps1 @@ -0,0 +1,64 @@ +#Requires -Version 5.1 +<# +.SYNOPSIS + Bootstrap script — downloads the Cameleer installer and runs it. +.EXAMPLE + irm https://gitea.siegeln.net/cameleer/cameleer-saas/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://gitea.siegeln.net/cameleer/cameleer-saas/raw' +if ($Version) { $RefPath = "tag/$Version" } +elseif ($Ref) { $RefPath = "branch/$Ref" } +else { $RefPath = 'branch/main' } + +$Base = "$Repo/$RefPath" +$Dir = '.\installer' + +$Files = @( + 'installer/install.sh' + 'installer/install.ps1' + 'installer/templates/docker-compose.yml' + 'installer/templates/docker-compose.saas.yml' + 'installer/templates/docker-compose.server.yml' + 'installer/templates/docker-compose.tls.yml' + 'installer/templates/docker-compose.monitoring.yml' + 'installer/templates/traefik-dynamic.yml' + 'installer/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 -replace '^installer/', '') + $localDir = Split-Path $localPath -Parent + if (-not (Test-Path $localDir)) { New-Item -ItemType Directory -Path $localDir -Force | Out-Null } + + Write-Host " $($file -replace '^installer/', '')" + try { + Invoke-WebRequest -Uri "$Base/$file" -OutFile $localPath -UseBasicParsing + } catch { + # install.ps1 may not exist yet — skip gracefully + if ($file -match 'install\.ps1$') { continue } + throw + } +} + +Write-Host '' +Write-Host "Installer ready in $Dir\" +Write-Host 'Run: cd installer; .\install.ps1' +Write-Host '' + +if ($Run) { + Set-Location $Dir + & .\install.ps1 @args +} diff --git a/get-cameleer.sh b/get-cameleer.sh new file mode 100644 index 0000000..5ed6130 --- /dev/null +++ b/get-cameleer.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +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 +# wget -qO- https://gitea.siegeln.net/cameleer/cameleer-saas/raw/branch/main/get-cameleer.sh | bash + +REPO="https://gitea.siegeln.net/cameleer/cameleer-saas/raw" +REF="branch/main" +DIR="./installer" + +# Parse --version / --ref +for arg in "$@"; do + case "$arg" in + --version=*) REF="tag/${arg#*=}"; shift ;; + --ref=*) REF="branch/${arg#*=}"; shift ;; + esac +done + +BASE="$REPO/$REF" + +FILES=( + "installer/install.sh" + "installer/templates/docker-compose.yml" + "installer/templates/docker-compose.saas.yml" + "installer/templates/docker-compose.server.yml" + "installer/templates/docker-compose.tls.yml" + "installer/templates/docker-compose.monitoring.yml" + "installer/templates/traefik-dynamic.yml" + "installer/templates/.env.example" +) + +echo "Downloading Cameleer installer..." + +mkdir -p "$DIR/templates" + +for file in "${FILES[@]}"; do + local_path="$DIR/${file#installer/}" + echo " ${file#installer/}" + curl -fsSL "$BASE/$file" -o "$local_path" +done + +chmod +x "$DIR/install.sh" + +echo "" +echo "Installer ready in $DIR/" +echo "Run: cd $DIR && ./install.sh" +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