Skip to content

Commit 7dd979f

Browse files
committed
Add script to build plugin OCI and tarball
Signed-off-by: Evangelos Skopelitis <[email protected]>
1 parent b096ca6 commit 7dd979f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

build-plugin.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
# This builds both the OCI image and the plugin tarball
3+
set -e
4+
set -o xtrace
5+
6+
# Ensure we have the plugin and the version
7+
if [ -z "$1"] || [ -z "$2" ]; then
8+
echo "Usage: $0 <plugin> <version>"
9+
exit 1
10+
fi
11+
12+
PLUGIN=$1
13+
VERSION=$2
14+
15+
# Build the OCI image
16+
echo "Building OCI image for ${PLUGIN}..."
17+
docker build --build-arg PLUGIN=${PLUGIN} -t headlamp-plugin-${PLUGIN}:${VERSION} .
18+
19+
# Build the plugin tarball
20+
echo "Building plugin tarball..."
21+
cd ${PLUGIN}
22+
npm install
23+
npm run build
24+
npm run package | tail -n2
25+
cd ..
26+
27+
echo "Finished building OCI image and plugin tarball."

0 commit comments

Comments
 (0)