pulumi/sdk/nodejs/scripts/download_node.sh
Sean Gillespie 05cb5368a4
Download and use a custom Node binary instead of linking against
private V8 APIs from within our native Node module.
2018-02-13 14:04:01 -08:00

21 lines
635 B
Bash
Executable file

#!/bin/bash
set -e
set -o nounset -o errexit -o pipefail
NODE_VERSION=v6.10.2
NODE_BASE=custom_node/node
NODE_EXE=$NODE_BASE/node
if [ -f $NODE_EXE ]; then
echo "skipping node.js executable download, as it already exists"
else
echo "node.js binary does not exist, downloading..."
OS=$(go env GOOS)
aws s3 cp --only-show-errors s3://eng.pulumi.com/releases/pulumi-node/$OS/$NODE_VERSION.tgz $NODE_BASE/$NODE_VERSION.tgz
TEMPDIR=$(mktemp -d)
tar -xvzf $NODE_BASE/$NODE_VERSION.tgz -C $TEMPDIR
cp $TEMPDIR/out/Release/node $NODE_BASE
rm -rf $TEMPDIR
rm -f $NODE_BASE/$NODE_VERSION.tgz
fi
echo "done!"