Unify plugin building (#2013)
This causes the build.sh script to chain to plugins.sh which makes plugin building behave the same for both local and release builds.
This commit is contained in:
1 parent
f9ce13c779
commit
f370abc1da
2 files changed
+17
-27
No files matched your search
+2
-16
@@ -38,27 +38,13 @@ case $(uname) in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
BINARY_SUFFIX=""
|
BINARY_SUFFIX=""
|
||||||
if [ "${GOOS}x" == "windowsx" ]; then
|
if [ "${GOOS}x" = "windowsx" ]; then
|
||||||
BINARY_SUFFIX=".exe"
|
BINARY_SUFFIX=".exe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build needed plugins first
|
# Build needed plugins first
|
||||||
if [ "${SKIP_PLUGIN_BUILD}x" == "x" ]; then
|
if [ "${SKIP_PLUGIN_BUILD}x" == "x" ]; then
|
||||||
ORIG_PATH=$(pwd);
|
$DIR/scripts/plugins.sh
|
||||||
for PLUGIN_TYPE in {"kms","host"}; do
|
|
||||||
echo "==> Building ${PLUGIN_TYPE} plugins..."
|
|
||||||
rm -f $ORIG_PATH/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}*
|
|
||||||
for CURR_PLUGIN in $(ls $ORIG_PATH/plugins/$PLUGIN_TYPE/mains); do
|
|
||||||
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/mains/$CURR_PLUGIN;
|
|
||||||
go build -v -o $ORIG_PATH/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}-${CURR_PLUGIN}${BINARY_SUFFIX} .;
|
|
||||||
cd $ORIG_PATH;
|
|
||||||
done;
|
|
||||||
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/assets;
|
|
||||||
for CURR_PLUGIN in $(ls boundary-plugin*); do
|
|
||||||
gzip -f -9 $CURR_PLUGIN;
|
|
||||||
done;
|
|
||||||
cd $ORIG_PATH;
|
|
||||||
done;
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${CI_BUILD}x" != "x" ]; then
|
if [ "${CI_BUILD}x" != "x" ]; then
|
||||||
|
|||||||
+15
-11
@@ -8,18 +8,22 @@ if [ "${GOOS}x" = "windowsx" ]; then
|
|||||||
BINARY_SUFFIX=".exe"
|
BINARY_SUFFIX=".exe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORIG_PATH=$(pwd);
|
# Get the parent directory of where this script is.
|
||||||
echo "==> Building Host Plugins..."
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
for PLUGIN_TYPE in host; do
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
rm -f $ORIG_PATH/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}*
|
export DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
for CURR_PLUGIN in $(ls $ORIG_PATH/plugins/$PLUGIN_TYPE/mains); do
|
|
||||||
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/mains/$CURR_PLUGIN;
|
for PLUGIN_TYPE in {"kms","host"}; do
|
||||||
go build -v -o $ORIG_PATH/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}-${CURR_PLUGIN}${BINARY_SUFFIX} .;
|
echo "==> Building ${PLUGIN_TYPE} plugins..."
|
||||||
cd $ORIG_PATH;
|
rm -f $DIR/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}*
|
||||||
|
for CURR_PLUGIN in $(ls $DIR/plugins/$PLUGIN_TYPE/mains); do
|
||||||
|
cd $DIR/plugins/$PLUGIN_TYPE/mains/$CURR_PLUGIN;
|
||||||
|
go build -v -o $DIR/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}-${CURR_PLUGIN}${BINARY_SUFFIX} .;
|
||||||
|
cd $DIR;
|
||||||
done;
|
done;
|
||||||
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/assets;
|
cd $DIR/plugins/$PLUGIN_TYPE/assets;
|
||||||
for CURR_PLUGIN in $(ls boundary-plugin*); do
|
for CURR_PLUGIN in $(ls boundary-plugin*); do
|
||||||
gzip -f -9 $CURR_PLUGIN;
|
gzip -f -9 $CURR_PLUGIN;
|
||||||
done;
|
done;
|
||||||
cd $ORIG_PATH;
|
cd $DIR;
|
||||||
done;
|
done;
|
||||||
Reference in new issue
Block a user