36 lines
863 B
Bash
Executable File
36 lines
863 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
|
|
${PIP_CMD} install --upgrade pip
|
|
pipenv install ${PIPENV_INSTALL_FLAGS}
|
|
|
|
# Install uswds node module and dependencies
|
|
npm install
|
|
|
|
# Relink uswds fonts into the /static directory
|
|
rm -f ./static/fonts
|
|
ln -s ../node_modules/uswds/src/fonts ./static/fonts
|
|
|
|
# Precompile assets for deployment
|
|
${WEBASSETS_CMD} -m atst.assets build
|