public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/oscillatord] rawhide: Add rebuild/release.sh: release both packages to every branch with one command
@ 2026-11-13 12:40 Oleg Obleukhov
  0 siblings, 0 replies; only message in thread
From: Oleg Obleukhov @ 2026-11-13 12:40 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/oscillatord
            Branch : rawhide
            Commit : 999916d645b977085d35fa1674771ef3306af1de
            Author : Oleg Obleukhov <leoleovich@fedoraproject.org>
            Date   : 2026-11-13T12:35:28+00:00
            Stats  : +511/-0 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/oscillatord/c/999916d645b977085d35fa1674771ef3306af1de?branch=rawhide

            Log:
            Add rebuild/release.sh: release both packages to every branch with one command

Replaces https://forge.fedoraproject.org/packaging/oscillatord-rebuild.

[skip changelog]

---
diff --git a/rebuild/README.md b/rebuild/README.md
new file mode 100644
index 0000000..b0ff944
--- /dev/null
+++ b/rebuild/README.md
@@ -0,0 +1,83 @@
+# Releasing oscillatord
+
+Releases [oscillatord](https://src.fedoraproject.org/rpms/oscillatord) and
+[disciplining-minipod](https://src.fedoraproject.org/rpms/disciplining-minipod) to Fedora and EPEL
+with one command. Replaces [oscillatord-rebuild](https://forge.fedoraproject.org/packaging/oscillatord-rebuild).
+
+## Release
+
+Tag `vVERSION` in both upstream repos
+([oscillatord](https://github.com/leoleovich/oscillatord),
+[disciplining-minipod](https://github.com/leoleovich/disciplining-minipod)), then from a checkout
+of this repo:
+
+```
+rebuild/release.sh 3.10.5
+```
+
+It bumps `Version:` in both specs on rawhide, uploads the tarballs with `fedpkg new-sources`,
+commits and pushes, and fast-forwards every release branch to rawhide. Then, for all branches at
+once, it requests a side tag, builds disciplining-minipod, builds oscillatord against it
+(`koji build --wait-build`) and files one Bodhi update from the side tag:
+
+```
+== Summary
+rawhide   oscillatord-3.10.5-1.fc46     https://bodhi.fedoraproject.org/updates/FEDORA-2026-...
+f45       oscillatord-3.10.5-1.fc45     https://bodhi.fedoraproject.org/updates/FEDORA-2026-...
+f44       ...
+f43       ...
+epel10    oscillatord-3.10.5-1.el10_4   https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-...
+epel10.3  oscillatord-3.10.5-1.el10_3   ...
+epel9     ...
+```
+
+Branches come from Bodhi: rawhide plus every active `fNN`, `epelNN` and EPEL minor branch
+(`epel10.3` is what the fleet runs). `epel8` is skipped: its ubloxcfg is 1.13, which lacks
+configuration keys oscillatord uses. ELN rebuilds from rawhide by itself. A new Fedora or EPEL
+release needs no change here.
+
+```
+rebuild/release.sh 3.10.5 --dry-run           # show the plan, change nothing
+rebuild/release.sh 3.10.5 --branches f44,epel9
+rebuild/release.sh --no-bump                  # rebuild what is already on rawhide
+rebuild/release.sh --shell                    # a shell in the release container
+```
+
+Rerunning the same command resumes: pushed commits, side tags (kept per version and branch),
+finished builds and existing updates are reused. A branch with commits that are not on rawhide is
+skipped and listed in the summary; merge it by hand and rerun.
+
+The release works in its own dist-git clones, not in your checkout: run `git pull` before you next
+commit here. Commits that only change `rebuild/` need `[skip changelog]` on a line of their own in
+the message, or they show up in the RPM changelog.
+
+## Requirements
+
+podman or docker, and `~/.ssh` with your Fedora key. Everything else runs in a throwaway
+`fedora:latest` container. You are asked once for your FAS password (the Kerberos ticket covers
+Koji, the lookaside cache and Bodhi and is cached between runs) and once for your SSH key
+passphrase. Set `FAS_USER` if it differs from `$USER`.
+
+State lives in `~/.cache/oscillatord-release`: the release's dist-git clones (don't edit them),
+the side tags and one log per branch under `work/state/VERSION/`.
+
+## By hand
+
+What `release.sh` does for one branch:
+
+```
+fedpkg request-side-tag --base-tag f44-build          # prints SIDETAG
+koji build --wait SIDETAG git+https://src.fedoraproject.org/rpms/disciplining-minipod.git#COMMIT
+koji build --wait --wait-build=disciplining-minipod-NVR SIDETAG git+https://src.fedoraproject.org/rpms/oscillatord.git#COMMIT
+bodhi updates new --autokarma --autotime --type enhancement --severity low --stable-karma 1 \
+  --from-tag SIDETAG --notes "Update to VERSION"
+```
+
+A build that already exists elsewhere goes into the side tag with `koji tag-build SIDETAG NVR`.
+
+## ubloxcfg
+
+Rarely changes, so it is not part of the release. To update it: bump `Version:` and
+`%global commit` in `ubloxcfg.spec` on rawhide, `spectool -g`, `fedpkg new-sources`, commit, push,
+fast-forward the release branches, then build it in each branch's side tag before
+disciplining-minipod and raise oscillatord's `BuildRequires: ubloxcfg-devel` if needed.

diff --git a/rebuild/bodhi_helper.py b/rebuild/bodhi_helper.py
new file mode 100755
index 0000000..f334af4
--- /dev/null
+++ b/rebuild/bodhi_helper.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+"""Bodhi helper for release-inner.sh.
+
+bodhi_helper.py releases                   active releases as dist-git branch names (rawhide and ELN excluded)
+bodhi_helper.py find NVR                   URL of an existing update containing NVR, or nothing
+bodhi_helper.py create-from-tag NOTES TAG  file one update from a Koji side tag, print its URL
+"""
+
+import re
+import sys
+
+from bodhi.client.bindings import BodhiClient
+
+
+def branch(release):
+    # F44 -> f44, EPEL-10.4 -> epel10; bodhi's "branch" field is the dist-git branch.
+    return release.get("branch") or release["name"].lower().replace("-", "")
+
+
+def order(b):
+    # Fedora first, then EPEL; newest first, the leading epelNN before its minor branches.
+    m = re.fullmatch(r"(f|epel)(\d+)(?:\.(\d+))?", b)
+    return (m.group(1) == "epel", -int(m.group(2)), m.group(3) is not None, -int(m.group(3) or 0))
+
+
+def main():
+    cmd = sys.argv[1]
+    client = BodhiClient()
+    if cmd == "releases":
+        # EPEL minor branches (epel10.3) are kept: the fleet runs the oldest supported EPEL 10 minor.
+        seen = set()
+        for state in ("current", "pending", "frozen"):
+            page = 1
+            while True:
+                resp = client.get_releases(state=state, page=page, rows_per_page=100)
+                for r in resp["releases"]:
+                    if r["id_prefix"] in ("FEDORA", "FEDORA-EPEL"):
+                        seen.add(branch(r))
+                if page >= resp.get("pages", 1):
+                    break
+                page += 1
+        keep = [b for b in seen if re.fullmatch(r"f\d+|epel\d+(\.\d+)?", b)]
+        print(" ".join(sorted(keep, key=order)))
+    elif cmd == "find":
+        for u in client.query(builds=sys.argv[2])["updates"]:
+            print(u["url"])
+            return
+    elif cmd == "create-from-tag":
+        notes, tag = sys.argv[2], sys.argv[3]
+        client.ensure_auth()
+        resp = client.save(
+            from_tag=tag,
+            type="enhancement",
+            severity="low",
+            notes=notes,
+            autokarma=True,
+            autotime=True,
+            stable_karma=1,
+            unstable_karma=-3,
+        )
+        for u in resp.get("updates", [resp]):
+            print(u["url"])
+    else:
+        sys.exit(f"unknown command {cmd}")
+
+
+if __name__ == "__main__":
+    main()

diff --git a/rebuild/release-inner.sh b/rebuild/release-inner.sh
new file mode 100755
index 0000000..3f22e85
--- /dev/null
+++ b/rebuild/release-inner.sh
@@ -0,0 +1,286 @@
+#!/usr/bin/env bash
+# Runs inside the release container started by release.sh. Not meant to be run directly.
+set -euo pipefail
+
+# Build order matters: oscillatord requires liboscillator-disciplining of the same version.
+pkgs=(disciplining-minipod oscillatord)
+# epel8 ships ubloxcfg 1.13 and oscillatord 3.10 needs 1.16.
+skip=(epel8)
+
+version=""
+branches=""
+bump=1
+dry=0
+while [ $# -gt 0 ]; do
+  case "$1" in
+    -b|--branches) branches=$2; shift 2 ;;
+    --no-bump) bump=0; shift ;;
+    --dry-run) dry=1; shift ;;
+    -*) echo "unknown option: $1" >&2; exit 2 ;;
+    *) version=$1; shift ;;
+  esac
+done
+[ -n "$version" ] || [ "$bump" = 0 ] || { echo "VERSION is required (or --no-bump)" >&2; exit 2; }
+
+log() { printf '\n\033[1m== %s\033[0m\n' "$*"; }
+die() { printf '\033[31mERROR:\033[0m %s\n' "$*" >&2; exit 1; }
+co() { echo "/tmp/release/git/$1"; }
+fp() { local p=$1; shift; fedpkg --path "$(co "$p")" --name "$p" "$@"; }
+verrel() { fp "$1" --release "$2" verrel 2>/dev/null | tail -1 || true; }
+spec_version() { sed -n -E 's/^Version:[[:space:]]+([^[:space:]]+).*/\1/p' "$(co "$1")/$1.spec"; }
+build_state() { koji --noauth buildinfo "$1" 2>/dev/null | sed -n -E 's/^State: ([A-Z]+).*/\1/p' || true; }
+build_tag() { koji --noauth list-targets --name "$1" --quiet 2>/dev/null | awk 'NR == 1 {print $2}' || true; }
+task_url() { echo "https://koji.fedoraproject.org/koji/taskinfo?taskID=$1"; }
+
+log "Installing packaging tools"
+dnf -y -q --setopt=install_weak_deps=False install fedpkg koji bodhi-client rpmdevtools rpmautospec \
+  krb5-workstation fedora-packager-kerberos git-core openssh-clients >/tmp/release/dnf.log 2>&1 \
+  || { tail -20 /tmp/release/dnf.log; die "package install failed"; }
+
+# Kerberos ticket in a file under the persistent state dir, so reruns within its lifetime don't prompt.
+export KRB5CCNAME=FILE:/tmp/release/krb5cc
+login() {
+  klist -s 2>/dev/null && klist 2>/dev/null | grep -q "@FEDORAPROJECT.ORG" && return
+  echo "Kerberos login for $FAS_USER@FEDORAPROJECT.ORG (covers Koji, the lookaside cache and Bodhi):"
+  fkinit -u "$FAS_USER"
+}
+
+# ~/.ssh is mounted read-only and may be owned by another uid; ssh needs a private copy.
+if [ -d /root/.ssh-host ]; then
+  cp -a /root/.ssh-host /root/.ssh
+  chown -R root:root /root/.ssh
+  chmod 700 /root/.ssh
+  find /root/.ssh -type f -exec chmod 600 {} +
+fi
+agent_pid=""
+ssh_login() {
+  [ -n "$agent_pid" ] && return
+  eval "$(ssh-agent -s)" >/dev/null
+  agent_pid=$SSH_AGENT_PID
+  echo "SSH key for dist-git pushes:"
+  ssh-add -q
+}
+
+declare -A job=()
+cleanup() {
+  [ ${#job[@]} -gt 0 ] && kill "${job[@]}" 2>/dev/null
+  [ -n "$agent_pid" ] && kill "$agent_pid" 2>/dev/null
+  if [ "$dry" = 1 ]; then
+    for p in "${pkgs[@]}"; do git -C "$(co "$p")" checkout -q -- "$p.spec" 2>/dev/null; done
+  fi
+  return 0
+}
+trap cleanup EXIT
+
+git config --global user.name "${GIT_NAME:-$FAS_USER}"
+git config --global user.email "${GIT_EMAIL:-$FAS_USER@fedoraproject.org}"
+
+log "Fetching dist-git"
+mkdir -p /tmp/release/git
+for p in "${pkgs[@]}"; do
+  d=$(co "$p")
+  [ -d "$d/.git" ] || git clone -q "https://src.fedoraproject.org/rpms/$p.git" "$d"
+  git -C "$d" remote set-url --push origin "ssh://$FAS_USER@pkgs.fedoraproject.org/rpms/$p.git"
+  git -C "$d" fetch -q origin
+  # The clone belongs to this tool: drop what an interrupted run left uncommitted, keep unpushed commits.
+  git -C "$d" checkout -q -f rawhide
+  git -C "$d" clean -fdq
+  git -C "$d" merge -q --ff-only origin/rawhide 2>/dev/null \
+    || die "$d has commits that diverge from origin/rawhide; push or delete them first"
+done
+
+if [ -z "$branches" ]; then
+  active=$(python3 /rebuild/bodhi_helper.py releases) || die "could not list active Bodhi releases"
+  list=(rawhide)
+  for b in $active; do
+    [[ " ${skip[*]} " == *" $b "* ]] && continue
+    ok=1
+    for p in "${pkgs[@]}"; do
+      d=$(co "$p")
+      git -C "$d" show-ref -q --verify "refs/remotes/origin/$b" || { ok=0; break; }
+      [ -z "$(git -C "$d" ls-tree --name-only "origin/$b" -- dead.package)" ] || { ok=0; break; }
+    done
+    [ "$ok" = 1 ] && list+=("$b")
+  done
+  branches=$(IFS=,; echo "${list[*]}")
+fi
+IFS=, read -r -a targets <<<"$branches"
+[ ${#targets[@]} -gt 0 ] || die "no branches to release"
+echo "branches: ${targets[*]}"
+
+need=()
+if [ "$bump" = 1 ]; then
+  for p in "${pkgs[@]}"; do
+    [ "$(spec_version "$p")" = "$version" ] || need+=("$p")
+  done
+  [ ${#need[@]} -gt 0 ] || echo "specs already at $version; nothing to bump"
+fi
+if [ ${#need[@]} -gt 0 ]; then
+  log "Preparing $version"
+  for p in "${need[@]}"; do
+    work=/tmp/release/src-$version/$p
+    mkdir -p "$work"
+    sed -E "s/^(Version:[[:space:]]+).*/\1$version/" "$(co "$p")/$p.spec" >"$work/$p.spec"
+    url=$(spectool -l -s 0 "$work/$p.spec" 2>/dev/null | sed -n -E 's/^Source0: //p')
+    [ -n "$url" ] || die "no Source0 in $p.spec"
+    if [ "$dry" = 1 ]; then
+      curl -fsSIL -o /dev/null "$url" || die "$url not found; is v$version tagged upstream?"
+    else
+      (cd "$work" && spectool -g -f -s 0 "$p.spec" >/dev/null) || die "could not download $url"
+    fi
+    echo "$p: $(spec_version "$p") -> $version  $url"
+  done
+fi
+
+# A stable branch is released only when it fast-forwards to rawhide in every package.
+declare -A blocked
+for b in "${targets[@]}"; do
+  [ "$b" = rawhide ] && continue
+  for p in "${pkgs[@]}"; do
+    git -C "$(co "$p")" merge-base --is-ancestor "origin/$b" rawhide \
+      || { blocked[$b]="$p/$b has commits not on rawhide; merge by hand"; break; }
+  done
+done
+
+if [ "$dry" = 1 ]; then
+  log "Plan (nothing changed)"
+  for p in "${need[@]}"; do cp "/tmp/release/src-$version/$p/$p.spec" "$(co "$p")/$p.spec"; done
+  for b in "${targets[@]}"; do
+    if [ -n "${blocked[$b]:-}" ]; then
+      printf '%-9s skipped: %s\n' "$b" "${blocked[$b]}"
+      continue
+    fi
+    line=""
+    for p in "${pkgs[@]}"; do
+      nvr=$(verrel "$p" "$b")
+      state=$(build_state "$nvr")
+      line+="  $nvr [${state:-new}]"
+    done
+    printf '%-9s side tag on %s:%s\n' "$b" "$(build_tag "$b")" "$line"
+  done
+  echo
+  echo "then: one Bodhi update per branch from its side tag"
+  exit 0
+fi
+
+log "Pushing to dist-git"
+login
+for p in "${need[@]}"; do
+  d=$(co "$p")
+  work=/tmp/release/src-$version/$p
+  cp "$work/$p.spec" "$d/$p.spec"
+  fp "$p" new-sources "$work"/*.tar.gz
+  git -C "$d" add "$p.spec" sources .gitignore
+  git -C "$d" commit -q -m "Update to $version"
+done
+ssh_login
+for p in "${pkgs[@]}"; do
+  d=$(co "$p")
+  refs=(rawhide)
+  for b in "${targets[@]}"; do
+    [ "$b" = rawhide ] || [ -n "${blocked[$b]:-}" ] || refs+=("rawhide:$b")
+  done
+  git -C "$d" push -q origin "${refs[@]}" || echo "push of $p reported errors, checking each branch"
+  git -C "$d" fetch -q origin
+  [ "$(git -C "$d" rev-parse origin/rawhide)" = "$(git -C "$d" rev-parse rawhide)" ] || die "push of $p rawhide failed"
+done
+release=()
+for b in "${targets[@]}"; do
+  [ -n "${blocked[$b]:-}" ] && continue
+  for p in "${pkgs[@]}"; do
+    d=$(co "$p")
+    [ "$(git -C "$d" rev-parse "origin/$b")" = "$(git -C "$d" rev-parse rawhide)" ] \
+      || { blocked[$b]="push of $p to $b rejected"; break; }
+  done
+  [ -n "${blocked[$b]:-}" ] || release+=("$b")
+done
+
+ver=$(spec_version oscillatord)
+run_dir=/tmp/release/state/$ver
+mkdir -p "$run_dir"
+
+say() { printf '%-9s %s\n' "$b" "$*" >&3; printf '%s\n' "$*"; }
+fail() { say "FAILED: $*"; echo "$*" >"$run_dir/$b.fail"; exit 1; }
+
+# One side tag per branch, so each chain sees its own fresh disciplining-minipod. Reruns reuse it.
+run_branch() {
+  b=$1
+  local sidetag="" tag nvr state sha out task prev="" deps
+  rm -f "$run_dir/$b.ok" "$run_dir/$b.fail"
+  [ -s "$run_dir/$b.sidetag" ] && sidetag=$(cat "$run_dir/$b.sidetag")
+  if [ -z "$sidetag" ] || ! koji --noauth taginfo "$sidetag" >/dev/null 2>&1; then
+    tag=$(build_tag "$b")
+    [ -n "$tag" ] || fail "no Koji target for $b"
+    sidetag=$(fp oscillatord request-side-tag --base-tag "$tag" 2>&1 | sed -n -E "s/^Side tag '([^']+)'.*/\1/p" | head -1)
+    [ -n "$sidetag" ] || fail "could not create a side tag on $tag"
+    echo "$sidetag" >"$run_dir/$b.sidetag"
+    say "side tag $sidetag"
+    koji wait-repo --timeout=120 "$sidetag" || fail "no repo for $sidetag"
+  fi
+  for p in "${pkgs[@]}"; do
+    nvr=$(verrel "$p" "$b")
+    [ -n "$nvr" ] || fail "cannot compute the $p NVR for $b"
+    state=$(build_state "$nvr")
+    if [ "$state" = COMPLETE ]; then
+      if ! koji --noauth list-tagged --quiet "$sidetag" "$p" | awk '{print $1}' | grep -qx "$nvr"; then
+        koji tag-build --wait "$sidetag" "$nvr" || fail "could not tag $nvr into $sidetag"
+      fi
+      say "$nvr already built"
+    else
+      sha=$(git -C "$(co "$p")" rev-parse "origin/$b")
+      deps=()
+      [ -n "$prev" ] && deps=("--wait-build=$prev")
+      out=$(koji build --nowait --fail-fast "${deps[@]}" "$sidetag" "git+https://src.fedoraproject.org/rpms/$p.git#$sha" 2>&1) \
+        || { echo "$out"; fail "could not start the $nvr build"; }
+      task=$(sed -n -E 's/^Created task: ([0-9]+).*/\1/p' <<<"$out" | head -1)
+      say "building $nvr  $(task_url "$task")"
+      koji watch-task --quiet "$task" || fail "$nvr  $(task_url "$task")"
+      say "$nvr built"
+    fi
+    prev=$nvr
+  done
+  echo "$sidetag $nvr" >"$run_dir/$b.ok"
+}
+
+log "Building ${release[*]} in parallel"
+exec 3>&1
+for b in "${release[@]}"; do
+  run_branch "$b" >"$run_dir/$b.log" 2>&1 &
+  job[$b]=$!
+done
+for b in "${release[@]}"; do
+  wait "${job[$b]}" || true
+  unset "job[$b]"
+done
+
+log "Bodhi updates"
+notes="Update to $ver: https://github.com/leoleovich/oscillatord/releases/tag/v$ver"
+declare -A update_url
+for b in "${release[@]}"; do
+  [ -s "$run_dir/$b.ok" ] || continue
+  read -r sidetag nvr <"$run_dir/$b.ok"
+  url=$(python3 /rebuild/bodhi_helper.py find "$nvr" || true)
+  [ -n "$url" ] || url=$(python3 /rebuild/bodhi_helper.py create-from-tag "$notes" "$sidetag" | head -1) || true
+  update_url[$b]=$url
+done
+
+log "Summary"
+rc=0
+for b in "${targets[@]}"; do
+  if [ -n "${update_url[$b]:-}" ]; then
+    read -r sidetag nvr <"$run_dir/$b.ok"
+    printf '%-9s %s  %s\n' "$b" "$nvr" "${update_url[$b]}"
+    continue
+  fi
+  rc=1
+  if [ -n "${blocked[$b]:-}" ]; then
+    printf '%-9s skipped: %s\n' "$b" "${blocked[$b]}"
+  elif [ -s "$run_dir/$b.ok" ]; then
+    printf '%-9s built, but no Bodhi update was created from %s\n' "$b" "$(cut -d' ' -f1 "$run_dir/$b.ok")"
+  else
+    printf '%-9s FAILED: %s (log: %s)\n' "$b" "$(cat "$run_dir/$b.fail" 2>/dev/null || echo "see log")" \
+      "${STATE_DIR:-~/.cache/oscillatord-release}/work/state/$ver/$b.log"
+  fi
+done
+[ "$rc" = 0 ] || echo -e "\nFix what failed and rerun the same command: finished builds and updates are reused."
+exit "$rc"

diff --git a/rebuild/release.sh b/rebuild/release.sh
new file mode 100755
index 0000000..7693dfc
--- /dev/null
+++ b/rebuild/release.sh
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# Release oscillatord and disciplining-minipod to rawhide and every active Fedora/EPEL branch.
+# The work runs in a throwaway Fedora container; this wrapper only starts it.
+set -euo pipefail
+
+usage() {
+  cat <<'EOF'
+Usage: rebuild/release.sh VERSION [options]
+
+Bumps disciplining-minipod and oscillatord to VERSION on rawhide, fast-forwards
+every active Fedora and EPEL branch to rawhide, then, for all branches in
+parallel, builds both packages in one Koji side tag per branch and files a
+Bodhi update from it. Prints the Bodhi links at the end.
+
+  -b, --branches LIST    comma-separated branches (default: rawhide plus every
+                         active fNN/epelNN branch in Bodhi, except epel8)
+      --no-bump          keep the specs as they are; only fast-forward, build, file updates
+      --dry-run          print the plan, change nothing (no Koji, no Bodhi, no push)
+      --shell            open a shell in the release container instead
+  -h, --help             show this help
+
+Needs podman or docker and ~/.ssh with your Fedora key for dist-git pushes.
+Asks once for your FAS password (Kerberos ticket for Koji, the lookaside cache
+and Bodhi, cached between runs) and once for your SSH key passphrase.
+
+Env: FAS_USER (default: $USER), RELEASE_IMAGE (default: registry.fedoraproject.org/fedora:latest)
+EOF
+}
+
+here=$(cd "$(dirname "$0")" && pwd)
+engine=${CONTAINER_ENGINE:-$(command -v podman || command -v docker || true)}
+[ -n "$engine" ] || { echo "podman or docker is required" >&2; exit 1; }
+image=${RELEASE_IMAGE:-registry.fedoraproject.org/fedora:latest}
+fas_user=${FAS_USER:-$USER}
+
+args=()
+shell=0
+while [ $# -gt 0 ]; do
+  case "$1" in
+    -h|--help) usage; exit 0 ;;
+    --shell) shell=1; shift ;;
+    -b|--branches) [ $# -ge 2 ] || { echo "$1 needs a value" >&2; exit 2; }; args+=("$1" "$2"); shift 2 ;;
+    --no-bump|--dry-run) args+=("$1"); shift ;;
+    -*) echo "unknown option: $1" >&2; usage >&2; exit 2 ;;
+    *) args+=("$1"); shift ;;
+  esac
+done
+
+state=${XDG_CACHE_HOME:-$HOME/.cache}/oscillatord-release
+mkdir -p "$state/work" "$state/bodhi"
+chmod 700 "$state" "$state/work" "$state/bodhi"
+
+tty=()
+[ -t 0 ] && tty=(-it)
+entry=(bash /rebuild/release-inner.sh "${args[@]}")
+[ "$shell" = 1 ] && entry=(bash)
+
+# Rootless podman maps container root to you, so commits and files stay yours.
+userns=()
+[ "$(basename "$engine")" = podman ] && [ "$(id -u)" != 0 ] && userns=("--userns=keep-id:uid=0,gid=0")
+
+exec "$engine" run --rm "${tty[@]}" "${userns[@]}" --network=host \
+  --security-opt label=disable \
+  -e FAS_USER="$fas_user" \
+  -e GIT_NAME="$(git config --global user.name 2>/dev/null || true)" \
+  -e GIT_EMAIL="$(git config --global user.email 2>/dev/null || true)" \
+  -e STATE_DIR="$state" \
+  -e http_proxy -e https_proxy -e HTTP_PROXY -e HTTPS_PROXY -e no_proxy -e NO_PROXY \
+  -v "$here:/rebuild:ro" \
+  -v "$HOME/.ssh:/root/.ssh-host:ro" \
+  -v "$state/work:/tmp/release" \
+  -v "$state/bodhi:/root/.config/bodhi" \
+  -w /tmp/release \
+  "$image" "${entry[@]}"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 12:40 [rpms/oscillatord] rawhide: Add rebuild/release.sh: release both packages to every branch with one command Oleg Obleukhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox