Port the launcher to Go on the podman API bindings
This commit is contained in:
+20
-10
@@ -1,16 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Package the launcher and default allowlist into an RPM with nfpm. The
|
||||
# packaged launcher defaults to the published images for this version.
|
||||
# Package the (already built) agent-sandbox binary, its shell completions 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]}")/.."
|
||||
|
||||
TAG="${1:-${CI_COMMIT_TAG:-v0.0.0-dev}}"
|
||||
mkdir -p dist
|
||||
sed "s/^VERSION=dev$/VERSION=$TAG/" agent-sandbox >dist/agent-sandbox
|
||||
grep -q "^VERSION=$TAG$" dist/agent-sandbox
|
||||
VERSION="${1:-${CI_COMMIT_TAG:-v0.0.0-dev}}"
|
||||
[[ $VERSION == dev ]] && VERSION=v0.0.0-dev
|
||||
DIST=dist
|
||||
BINARY=agent-sandbox
|
||||
|
||||
export PACKAGE_VERSION="${TAG#v}"
|
||||
envsubst <packaging/nfpm.yaml >dist/nfpm.yaml
|
||||
nfpm pkg --config dist/nfpm.yaml --target dist --packager rpm
|
||||
ls -1 dist/*.rpm
|
||||
if [[ ! -f $DIST/$BINARY ]]; then
|
||||
echo "ERROR: $DIST/$BINARY not found; run 'make bin' first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$DIST/completions"
|
||||
"./$DIST/$BINARY" completion bash >"$DIST/completions/$BINARY.bash"
|
||||
"./$DIST/$BINARY" completion zsh >"$DIST/completions/_$BINARY"
|
||||
"./$DIST/$BINARY" completion fish >"$DIST/completions/$BINARY.fish"
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user