File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ if [ -z "${DOCKER_BIN}" ]; then
16
16
exit 1
17
17
fi
18
18
19
+ # default PYTHONPATH such that directly executing files in the repo "just works"
20
+ # NOTE: this is hard-coded to the mount point used within the container
21
+ PYTHONPATH=' /usr/app/src'
22
+
19
23
# default any variables for local development
20
24
MIG_ENV=${MIG_ENV:- ' local' }
21
25
40
44
41
45
# execute python2 within the image passing the supplied arguments
42
46
43
- ${DOCKER_BIN} run -it --rm --mount type=bind,source=.,target=/usr/src/app --env " MIG_ENV=$MIG_ENV " " $IMAGEID " python2 " $@ "
47
+ ${DOCKER_BIN} run -it --rm \
48
+ --mount type=bind,source=.,target=/usr/src/app \
49
+ --env " PYTHONPATH=$PYTHON_PATH " \
50
+ --env " MIG_ENV=$MIG_ENV " \
51
+ " $IMAGEID " python2 " $@ "
Original file line number Diff line number Diff line change 6
6
7
7
SCRIPT_PATH=$( realpath " $0 " )
8
8
SCRIPT_BASE=$( dirname -- " $SCRIPT_PATH " )
9
+ MIG_BASE=$( realpath " $SCRIPT_BASE /.." )
9
10
PYTHON3_BIN=" $SCRIPT_BASE /venv/bin/python3"
10
11
11
12
if [ ! -f " ${PYTHON3_BIN} " ]; then
12
13
echo " No python3 binary found - perhaps the virtual env was not created"
13
14
exit 1
14
15
fi
15
16
17
+ # default PYTHONPATH such that directly executing files in the repo "just works"
18
+ PYTHONPATH=${PYTHONPATH:- " $MIG_BASE " }
19
+
16
20
# default any variables for local development
17
21
MIG_ENV=${MIG_ENV:- ' local' }
18
22
19
23
echo " running with MIG_ENV='$MIG_ENV ' under python 3"
20
24
echo
21
25
22
- MIG_ENV=" $MIG_ENV " " $PYTHON3_BIN " " $@ "
26
+ PYTHONPATH= " $PYTHONPATH " MIG_ENV=" $MIG_ENV " " $PYTHON3_BIN " " $@ "
You can’t perform that action at this time.
0 commit comments