atst/script/bootstrap
2018-07-03 09:54:52 -04:00

33 lines
760 B
Bash
Executable File

#!/bin/bash
# script/bootstrap: Resolve all dependencies that the application requires to
# run.
# If a command fails, exit the script
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "${0}")/.."
if [ -z "${CIBUILD+xxxx}" ]; then
CMD_PREFIX='pipenv run '
fi
PIP_CMD="${CMD_PREFIX}pip"
WEBASSETS_CMD="${CMD_PREFIX}webassets"
PIPENV_INSTALL_FLAGS='--dev'
if [ -n "${CIBUILD}" ]; then
PIPENV_INSTALL_FLAGS+=' --system --ignore-pipfile'
fi
# Install Python dependencies
pipenv --python 3.6
${PIP_CMD} install --upgrade pip
pipenv install ${PIPENV_INSTALL_FLAGS}
# Install uswds node module and dependencies
npm install
# Precompile assets for deployment
${WEBASSETS_CMD} -m atst.assets build