Skip to content

Commit

Permalink
Fix docker_generate_datamodels.sh
Browse files Browse the repository at this point in the history
The script `docker_generate_datamodels.sh` has been broken since we
started using virtual envs in the CI scripts a few weeks ago. Since
`build.sh` installs `zivid` in a venv, `generate_datamodels.sh` would
fail to find the package since it was not running in the same venv. This
commit fixes this by making `generate_datamodels.sh` activate the CI
venv set up by the previous steps. We only do this if there is no venv
currently activated, because we still want developers to be able to run
`generate_datamodels.sh` directly with their own venv.
  • Loading branch information
eskaur committed Jul 14, 2023
1 parent 9f47f13 commit 7009a8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions continuous-integration/code-generation/generate_datamodels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR=$(realpath "$SCRIPT_DIR/../..")

if [ -z "$VIRTUAL_ENV" ]; then
source $SCRIPT_DIR/../linux/venv.sh || exit $?
activate_venv || exit $?
fi

python3 -m pip install --requirement "$SCRIPT_DIR/../python-requirements/lint.txt" || exit $?

python3 "$ROOT_DIR/continuous-integration/code-generation/datamodel_frontend_generator.py" \
Expand Down

0 comments on commit 7009a8d

Please sign in to comment.