Build an OpenBao RPM alongside the Vault one
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

The plugin runs under both Vault and OpenBao, but nfpm only produced a
single RPM that installs into /opt/vault-plugins. OpenBao hosts expect
their plugins under /opt/openbao-plugins, so a second package is needed.

- Parameterize nfpm.yaml with PACKAGE_NAME, PACKAGE_PLUGIN_DIR, and
  PACKAGE_PREINSTALL so one config renders per target server
- Replace the static preinstall.sh with preinstall.sh.tmpl that
  mkdir -p's the flavour's plugin directory
- Build two RPMs in build-rpm.sh via a build_flavor helper:
  vault-plugin-secrets-litellm -> /opt/vault-plugins and
  openbao-plugin-secrets-litellm -> /opt/openbao-plugins
This commit is contained in:
2026-07-06 23:14:43 +10:00
parent a55bc77f38
commit ac38203b8e
4 changed files with 30 additions and 13 deletions
+8 -6
View File
@@ -1,6 +1,8 @@
---
# nfpm config for building the vault-plugin-secrets-litellm RPM.
# Rendered through envsubst (see scripts/build-rpm.sh) then fed to `nfpm pkg`.
# Built once per target server (Vault, OpenBao); PACKAGE_NAME and
# PACKAGE_PLUGIN_DIR vary per flavour.
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
@@ -18,19 +20,19 @@ license: ${PACKAGE_LICENSE}
disable_globbing: false
replaces:
- vault-plugin-secrets-litellm
- ${PACKAGE_NAME}
provides:
- vault-plugin-secrets-litellm
- ${PACKAGE_NAME}
# Install the plugin binary into the Vault/OpenBao plugin directory. Point the
# server's plugin_directory at /opt/vault-plugins to pick it up.
# Install the plugin binary into the server's plugin directory. Point the
# server's plugin_directory at PACKAGE_PLUGIN_DIR to pick it up.
contents:
- src: dist/vault-plugin-secrets-litellm
dst: /opt/vault-plugins/vault-plugin-secrets-litellm
dst: ${PACKAGE_PLUGIN_DIR}/vault-plugin-secrets-litellm
file_info:
mode: 0755
owner: root
group: root
scripts:
preinstall: packaging/scripts/preinstall.sh
preinstall: ${PACKAGE_PREINSTALL}
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
mkdir -p /opt/vault-plugins
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
# Rendered per flavour via envsubst (see scripts/build-rpm.sh).
mkdir -p ${PACKAGE_PLUGIN_DIR}