Moving virtual environments between systems is problematic... and unnecessary when creating container images. These modifications allow the ability to install app dependencies into the system python, and use that instead of a virtual environment.
33 lines
751 B
Bash
Executable File
33 lines
751 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 ${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
|