Translate scripts, comments and README to English
This commit is contained in:
1 parent
9196e0da4a
commit
3cc2ea573f
7 files changed
+65
-65
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# Stoppt das lokale Forgejo. Mit -Purge werden zusätzlich Container, Daten-Volume und .forgejo-token gelöscht.
|
||||
# Stops the local Forgejo. With -Purge, the container, the data volume and .forgejo-token are deleted as well.
|
||||
param([switch]$Purge)
|
||||
|
||||
podman stop renovate-forgejo 2>$null | Out-Null
|
||||
@@ -6,7 +6,7 @@ if ($Purge) {
|
||||
podman rm -f renovate-forgejo 2>$null | Out-Null
|
||||
podman volume rm -f renovate-forgejo-data 2>$null | Out-Null
|
||||
Remove-Item (Join-Path $PSScriptRoot '.forgejo-token') -ErrorAction SilentlyContinue
|
||||
Write-Host 'Forgejo inkl. Daten entfernt' -ForegroundColor Cyan
|
||||
Write-Host 'Forgejo removed including all data' -ForegroundColor Cyan
|
||||
} else {
|
||||
Write-Host 'Forgejo gestoppt (Daten bleiben erhalten; -Purge zum Löschen)' -ForegroundColor Cyan
|
||||
Write-Host 'Forgejo stopped (data is kept; use -Purge to delete it)' -ForegroundColor Cyan
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
# Setzt das lokale Forgejo komplett zurück: alles löschen (inkl. Repo, PRs, Token) und frisch starten.
|
||||
# Resets the local Forgejo completely: delete everything (including repos, PRs, tokens) and start fresh.
|
||||
& (Join-Path $PSScriptRoot 'forgejo-down.ps1') -Purge
|
||||
& (Join-Path $PSScriptRoot 'forgejo-up.ps1')
|
||||
+11
-11
@@ -1,12 +1,12 @@
|
||||
# Startet ein lokales Forgejo (Git-Server) in Podman, legt den Bot-User "renovate" an
|
||||
# und speichert ein frisches Access-Token in .forgejo-token (wird von renovate-update.ps1 gelesen).
|
||||
# Starts a local Forgejo (Git server) in Podman, creates the bot user "renovate"
|
||||
# and stores a fresh access token in .forgejo-token (read by renovate-update.ps1).
|
||||
$ts = Get-Date -Format 'yyyy-MM-dd-HH-mm-ss-fff'
|
||||
$tokenFile = Join-Path $PSScriptRoot '.forgejo-token'
|
||||
$username = 'renovate'
|
||||
$password = 'renovate'
|
||||
|
||||
# 1. Container starten – beim ersten Mal anlegen.
|
||||
# ENABLE_PUSH_CREATE_USER: ein Repo wird beim ersten "git push" automatisch angelegt.
|
||||
# 1. Start the container - create it on first run.
|
||||
# ENABLE_PUSH_CREATE_USER: a repository is created automatically on the first "git push".
|
||||
podman start renovate-forgejo 2>$null | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
podman run -d --name renovate-forgejo -p 3000:3000 -v renovate-forgejo-data:/data `
|
||||
@@ -14,22 +14,22 @@ if ($LASTEXITCODE -ne 0) {
|
||||
-e FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true `
|
||||
-e FORGEJO__repository__DEFAULT_BRANCH=main `
|
||||
codeberg.org/forgejo/forgejo:11 | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Forgejo-Container konnte nicht gestartet werden' }
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Could not start the Forgejo container' }
|
||||
}
|
||||
Write-Host 'Warte auf Forgejo ...'
|
||||
Write-Host 'Waiting for Forgejo ...'
|
||||
do {
|
||||
Start-Sleep -Seconds 1
|
||||
try { $ready = (Invoke-WebRequest 'http://localhost:3000/api/healthz' -UseBasicParsing).StatusCode -eq 200 } catch { $ready = $false }
|
||||
} until ($ready)
|
||||
|
||||
# 2. Bot-User anlegen (Fehler ignorieren, falls er schon existiert) und ein frisches Access-Token erzeugen
|
||||
# 2. Create the bot user (ignore the error if it already exists) and generate a fresh access token
|
||||
podman exec -u git renovate-forgejo forgejo admin user create --admin --username $username `
|
||||
--password $password --email renovate@localhost --must-change-password=false 2>$null | Out-Null
|
||||
$token = podman exec -u git renovate-forgejo forgejo admin user generate-access-token `
|
||||
--username $username --token-name "renovate-$ts" --scopes all --raw
|
||||
Set-Content -Path $tokenFile -Value $token -NoNewline
|
||||
|
||||
Write-Host "`nForgejo läuft: http://localhost:3000" -ForegroundColor Cyan
|
||||
Write-Host " Benutzer: $username"
|
||||
Write-Host " Passwort: $password"
|
||||
Write-Host " Token gespeichert in $tokenFile"
|
||||
Write-Host "`nForgejo is running: http://localhost:3000" -ForegroundColor Cyan
|
||||
Write-Host " Username: $username"
|
||||
Write-Host " Password: $password"
|
||||
Write-Host " Token saved to $tokenFile"
|
||||
@@ -1,14 +1,14 @@
|
||||
# Nur prüfen: Renovate läuft mit der "local"-Plattform direkt auf diesem Verzeichnis
|
||||
# und ändert nichts. Gefundene Updates werden aus dem JSON-Report gelesen und ausgegeben.
|
||||
# Renovate braucht Node.js >= 24.11
|
||||
if ([version](node -v).TrimStart('v') -lt [version]'24.11.0') { throw "Renovate braucht Node.js >= 24.11, gefunden: $(node -v). Z. B.: volta install node@24" }
|
||||
# Check only: Renovate runs with the "local" platform directly on this directory
|
||||
# and changes nothing. Found updates are read from the JSON report and printed.
|
||||
# Renovate requires Node.js >= 24.11
|
||||
if ([version](node -v).TrimStart('v') -lt [version]'24.11.0') { throw "Renovate requires Node.js >= 24.11, found: $(node -v). E.g.: volta install node@24" }
|
||||
$report = Join-Path ([IO.Path]::GetTempPath()) 'renovate-report.json'
|
||||
|
||||
Push-Location (Join-Path $PSScriptRoot '..') # Repo-Root
|
||||
Push-Location (Join-Path $PSScriptRoot '..') # repository root
|
||||
npx --yes renovate@44.149.3 --platform=local --dry-run=lookup --report-type=file --report-path=$report
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nGefundene Updates:" -ForegroundColor Cyan
|
||||
Write-Host "`nAvailable updates:" -ForegroundColor Cyan
|
||||
$packageFiles = (Get-Content $report -Raw -Encoding UTF8 | ConvertFrom-Json).repositories.local.packageFiles
|
||||
foreach ($manager in $packageFiles.PSObject.Properties) {
|
||||
foreach ($file in $manager.Value) {
|
||||
|
||||
+19
-19
@@ -1,30 +1,30 @@
|
||||
# Renovate-Lauf gegen ein Forgejo (lokal per script\forgejo-up.ps1 gestartet).
|
||||
# Jeder Lauf erzeugt einen neuen Branch + PR mit Zeitstempel: renovate/<yyyy-MM-dd-HH-mm-ss-fff>-all
|
||||
# Renovate run against a Forgejo (started locally via script\forgejo-up.ps1).
|
||||
# Every run creates new branches + PRs with a timestamp: renovate/<yyyy-MM-dd-HH-mm-ss-fff>-<group>
|
||||
$endpoint = 'http://localhost:3000'
|
||||
$repo = 'renovate/renovate-test'
|
||||
$tokenFile = Join-Path $PSScriptRoot '.forgejo-token'
|
||||
|
||||
# Renovate braucht Node.js >= 24.11
|
||||
if ([version](node -v).TrimStart('v') -lt [version]'24.11.0') { throw "Renovate braucht Node.js >= 24.11, gefunden: $(node -v). Z. B.: volta install node@24" }
|
||||
# Forgejo muss laufen und ein Token muss vorhanden sein
|
||||
try { Invoke-WebRequest "$endpoint/api/healthz" -UseBasicParsing | Out-Null } catch { throw "Forgejo unter $endpoint nicht erreichbar – zuerst .\script\forgejo-up.ps1 ausführen" }
|
||||
if (-not (Test-Path $tokenFile)) { throw "$tokenFile fehlt – zuerst .\script\forgejo-up.ps1 ausführen" }
|
||||
# Renovate requires Node.js >= 24.11
|
||||
if ([version](node -v).TrimStart('v') -lt [version]'24.11.0') { throw "Renovate requires Node.js >= 24.11, found: $(node -v). E.g.: volta install node@24" }
|
||||
# Forgejo must be running and a token must exist
|
||||
try { Invoke-WebRequest "$endpoint/api/healthz" -UseBasicParsing | Out-Null } catch { throw "Forgejo is not reachable at $endpoint - run .\script\forgejo-up.ps1 first" }
|
||||
if (-not (Test-Path $tokenFile)) { throw "$tokenFile is missing - run .\script\forgejo-up.ps1 first" }
|
||||
|
||||
$token = (Get-Content $tokenFile -Raw).Trim()
|
||||
$now = Get-Date
|
||||
$ts = $now.ToString('yyyy-MM-dd-HH-mm-ss-fff') # für den Branch-Namen (keine ':' oder Leerzeichen erlaubt)
|
||||
$prTimestamp = $now.ToString('yyyy-MM-dd HH:mm:ss.fff') # für den PR-Titel
|
||||
$ts = $now.ToString('yyyy-MM-dd-HH-mm-ss-fff') # for the branch name (no ':' or spaces allowed)
|
||||
$prTimestamp = $now.ToString('yyyy-MM-dd HH:mm:ss.fff') # for the PR title
|
||||
$gitUrl = $endpoint -replace '://', "://renovate:$token@"
|
||||
$gitUrl = "$gitUrl/$repo.git"
|
||||
Push-Location (Join-Path $PSScriptRoot '..') # Repo-Root
|
||||
Push-Location (Join-Path $PSScriptRoot '..') # repository root
|
||||
|
||||
# 1. Lokalen Stand von main nach Forgejo pushen (ohne Credential-Helper, die Zugangsdaten stehen in der URL)
|
||||
# 1. Push the local state of main to Forgejo (without credential helper, the credentials are in the URL)
|
||||
git -c credential.helper= push $gitUrl main:main
|
||||
if ($LASTEXITCODE -ne 0) { Pop-Location; throw 'git push fehlgeschlagen' }
|
||||
if ($LASTEXITCODE -ne 0) { Pop-Location; throw 'git push failed' }
|
||||
|
||||
# 2. Renovate laufen lassen. Branch-Präfix mit Zeitstempel => jeder Lauf erzeugt einen neuen Branch + PR.
|
||||
# branch-prefix-old verhindert, dass Renovate Branches früherer Läufe wiederverwendet.
|
||||
# Per Env-Variable: der Commit-Autor und der Zeitstempel im PR-Titel (commitMessageSuffix gibt es nicht als CLI-Flag).
|
||||
# 2. Run Renovate. Branch prefix with timestamp => every run creates new branches + PRs.
|
||||
# branch-prefix-old prevents Renovate from reusing branches of previous runs.
|
||||
# Via environment variables: the commit author and the timestamp in the PR title (commitMessageSuffix has no CLI flag).
|
||||
$env:RENOVATE_GIT_AUTHOR = 'Renovate Bot <renovate@localhost>'
|
||||
$env:RENOVATE_COMMIT_MESSAGE_SUFFIX = $prTimestamp
|
||||
npx --yes renovate@44.149.3 `
|
||||
@@ -33,11 +33,11 @@ npx --yes renovate@44.149.3 `
|
||||
$repo
|
||||
$renovateExitCode = $LASTEXITCODE
|
||||
Remove-Item Env:RENOVATE_GIT_AUTHOR, Env:RENOVATE_COMMIT_MESSAGE_SUFFIX
|
||||
if ($renovateExitCode -ne 0) { Pop-Location; throw 'Renovate fehlgeschlagen' }
|
||||
if ($renovateExitCode -ne 0) { Pop-Location; throw 'Renovate failed' }
|
||||
|
||||
# 3. Renovate-Branches ins lokale Repo holen (als forgejo/renovate/...)
|
||||
# 3. Fetch the Renovate branches into the local repository (as forgejo/renovate/...)
|
||||
git -c credential.helper= fetch -q --prune $gitUrl '+refs/heads/renovate/*:refs/remotes/forgejo/renovate/*'
|
||||
Write-Host "`nNeuer Branch:" -ForegroundColor Cyan
|
||||
Write-Host "`nNew branches:" -ForegroundColor Cyan
|
||||
git branch -r --list "forgejo/renovate/$ts-*"
|
||||
Write-Host "PRs: $endpoint/$repo/pulls (Login: renovate / renovate)"
|
||||
Write-Host "PRs: $endpoint/$repo/pulls (login: renovate / renovate)"
|
||||
Pop-Location
|
||||
Reference in new issue
Block a user