Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
fix: --opbeans-node-agent-local-repo=/a/local/dir
Browse files Browse the repository at this point in the history
Fixes './scripts/compose.py start --opbeans-node-agent-local-repo=$dir'
to (a) install the Node.js APM agent into the opbeans-node app at "/app"
and (b) to skip copying the possibly large node_modules and build dirs
for speed.

Fixes: #1083
  • Loading branch information
trentm committed Mar 22, 2021
1 parent c6c8e10 commit 0c2e45e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docker/opbeans/node/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env sh
set -ex
if [ -f /local-install/package.json ]; then
echo "Installing from local folder"
# copy to folder inside container to ensure were not poluting the local folder
cp -r /local-install ~
cd ~/local-install && npm install .
cd -
echo "Installing elastic-apm-node from local folder (--opbeans-node-agent-local-repo)"
# Copy to a folder inside container to ensure we're not polluting the
# local folder. Skip possibly huge dirs to speed this up.
apk add rsync
rsync -a /local-install/ ~/local-install/ --exclude node_modules --exclude build --exclude .git
# Install elastic-apm-node from this copied dir.
npm install ~/local-install
npm ls elastic-apm-node
elif [ -n "${NODE_AGENT_VERSION}" ]; then
echo "Installing ${NODE_AGENT_VERSION} from npm"
npm install elastic-apm-node@"${NODE_AGENT_VERSION}"
Expand Down

0 comments on commit 0c2e45e

Please sign in to comment.