Skip to content

Add script to build plugin OCI and tarball #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build-plugin.sh
Original file line number Diff line number Diff line change
@@ -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 <plugin> <version>"
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."
Loading