pulumi/scripts/install.sh
2017-07-23 11:17:18 -06:00

31 lines
892 B
Bash
Executable file

#!/bin/bash
# install.sh will download and install the current bits from the usual share location and binplace them.
# The first argument is the Git commit hash to fetch and the second is the target location to install them into.
set -e
GITVER=${1}
INSTALLDIR=${2}
if [ -z "${GITVER}" ]; then
echo error: missing Git commit/tag/branch argument
exit 1
fi
if [ -z "${INSTALLDIR}" ]; then
echo error: missing target installation directory
exit 2
fi
# Make the directory, download the bits, and unzip/tar them in place.
RELEASE=s3://eng.pulumi.com/releases/lumi/${GITVER}.tgz
echo Installing ${RELEASE} to: ${PUBTARGET}
mkdir -p ${INSTALLDIR}
aws s3 cp ${RELEASE} ${INSTALLDIR}
tar -xzf ${INSTALLDIR}/${GITVER}.tgz -C ${INSTALLDIR}
# Finally, link the bits so that NPM packages link to the right place.
for pack in ${INSTALLDIR}/packs/*; do
cd ${pack} && yarn link
done