Skip to content

Commit

Permalink
Plugins: Build plugin with two os-specific vendor dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilija-lazoroski authored and mssalvatore committed May 2, 2023
1 parent 8f90fe0 commit 3622ee3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions monkey/agent_plugins/build_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

pushd "$PLUGIN_PATH" || fail "$PLUGIN_PATH does not exist"
VENDOR_DIR=vendor
if [ -d "src/vendor-windows" ]; then
VENDOR_DIR=vendor-linux
fi

pip install pipenv
pipenv requirements >> requirements.txt
pip install -r requirements.txt -t src/vendor
pip install -r requirements.txt -t src/$VENDOR_DIR
rm requirements.txt

# Package everything up
Expand All @@ -32,7 +37,7 @@ pushd "$PLUGIN_PATH/src" || fail "$PLUGIN_PATH/src does not exist"
source_archive=$PLUGIN_PATH/$SOURCE_FILENAME
tar -cf "$source_archive" --exclude __pycache__ --exclude .mypy_cache --exclude .pytest_cache --exclude .git --exclude .gitignore --exclude .DS_Store -- *

rm -rf vendor
rm -rf vendor*
popd || exit 1

plugin_filename=$(get_plugin_filename) || fail "Failed to get plugin filename: $plugin_filename"
Expand Down

0 comments on commit 3622ee3

Please sign in to comment.