Files
MeterVault/deploy/build-and-push.ps1
T
schmidt.florian 39da00d486
ci / build-test (push) Successful in 1m15s
version-tag / tag-if-newer (push) Successful in 6s
Switch to master branch + Gitea Actions
- Move CI/release workflows from .github/workflows to .gitea/workflows (Gitea Actions),
  targeting the master branch.
- docker-publish: push to the Gitea container registry (git.finalfactory.de) with a
  lowercased image name; login via github.token or a PACKAGES_TOKEN secret.
- version-tag: gitea-actions bot identity; optional RELEASE_TOKEN to re-trigger the image build.
- Update README/CLAUDE.md/Unraid template/build-and-push.ps1 to the Gitea registry + master.

Claude-Session: https://claude.ai/code/session_01WujdMtMJPbxDpDnMeK22rr
2026-07-13 16:26:04 +02:00

33 lines
1.1 KiB
PowerShell

#!/usr/bin/env pwsh
# Local convenience: build the multi-arch MeterVault image and push it.
# Usage: ./deploy/build-and-push.ps1 -Registry git.finalfactory.de -Image finalfactory/metervault -Push
# Version is read from the VERSION file; images are tagged :<version> and :latest.
param(
[string]$Registry = "git.finalfactory.de",
[string]$Image = "finalfactory/metervault",
[string[]]$Platforms = @("linux/amd64", "linux/arm64"),
[switch]$Push
)
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot
$version = (Get-Content (Join-Path $root "VERSION")).Trim()
$ref = "$Registry/$Image"
Write-Host "Building $ref:$version ($($Platforms -join ', '))" -ForegroundColor Cyan
$args = @(
"buildx", "build",
"--platform", ($Platforms -join ","),
"-f", (Join-Path $root "deploy/Dockerfile"),
"-t", "$ref`:$version",
"-t", "$ref`:latest"
)
if ($Push) { $args += "--push" } else { $args += "--load" }
$args += $root
& docker @args
if ($LASTEXITCODE -ne 0) { throw "docker buildx build failed" }
Write-Host "Done." -ForegroundColor Green