From bc35c20a75eec9703374385aa248335977f4d687 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Thu, 27 Feb 2025 13:49:17 -0500 Subject: [PATCH] Add script to build plugin OCI and tarball Signed-off-by: Evangelos Skopelitis --- build-plugin.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 build-plugin.sh diff --git a/build-plugin.sh b/build-plugin.sh new file mode 100644 index 000000000..4e80d9930 --- /dev/null +++ b/build-plugin.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# This builds both the OCI image and the plugin tarball +set -e +set -o xtrace + +# Ensure we have the plugin and the version +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 " + exit 1 +fi + +PLUGIN=$1 +VERSION=$2 + +# Build the OCI image +echo "Building OCI image for ${PLUGIN}..." +docker buildx build --build-arg PLUGIN=${PLUGIN} -t headlamp-plugin-${PLUGIN}:${VERSION} . + +# Build the plugin tarball +echo "Building plugin tarball..." +cd ${PLUGIN} +npm install +npm run build +npx @kinvolk/headlamp-plugin package | tail -n2 +cd .. + +echo "Finished building OCI image and plugin tarball." \ No newline at end of file