Files
unkin-agent 2e3dafb28a
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Drop shell completions from the RPM
2026-10-24 17:38:05 +11:00

22 lines
660 B
Bash
Executable File

#!/usr/bin/env bash
# Package the (already built) agent-sandbox binary and the default
# allowlist into an RPM with nfpm.
# Usage: scripts/build-rpm.sh [version] (defaults to $CI_COMMIT_TAG)
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
VERSION="${1:-${CI_COMMIT_TAG:-v0.0.0-dev}}"
[[ $VERSION == dev ]] && VERSION=v0.0.0-dev
DIST=dist
BINARY=agent-sandbox
if [[ ! -f $DIST/$BINARY ]]; then
echo "ERROR: $DIST/$BINARY not found; run 'make bin' first" >&2
exit 1
fi
export PACKAGE_VERSION="${VERSION#v}"
envsubst <packaging/nfpm.yaml >"$DIST/nfpm.yaml"
nfpm pkg --config "$DIST/nfpm.yaml" --target "$DIST" --packager rpm
ls -1 "$DIST"/*.rpm