File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 22# lightest possible entrypoint that ensures that
33# we use a login shell to get a fully configured shell environment
44# (e.g. sourcing /etc/profile.d, ~/.bashrc, and friends)
5+
6+ # Setup a file descriptor (FD) that is connected to a tee process which
7+ # writes its input to $REPO_DIR/.jupyter-server-log.txt
8+ # We later use this FD as a place to redirect the output of the actual
9+ # command to. We can't add `tee` to the command directly as that will prevent
10+ # the container from exiting when `docker stop` is run.
11+ # See https://stackoverflow.com/a/55678435
12+ exec {log_fd}> >( exec tee $REPO_DIR /.jupyter-server-log.txt)
13+
514if [[ ! -z " ${R2D_ENTRYPOINT:- } " ]]; then
615 if [[ ! -x " $R2D_ENTRYPOINT " ]]; then
716 chmod u+x " $R2D_ENTRYPOINT "
817 fi
9- exec " $R2D_ENTRYPOINT " " $@ "
18+ exec " $R2D_ENTRYPOINT " " $@ " >& " $log_fd "
1019else
11- exec " $@ "
20+ exec " $@ " >& " $log_fd "
1221fi
22+
23+ # Close the logging output again
24+ # exec {log_fd}>&-
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ def test_env():
5858
5959 # all docker output is returned by repo2docker on stderr
6060 # extract just the declare for better failure message formatting
61+ # stdout should be empty
62+ assert not result .stdout
63+
64+ # stderr should contain lines of output
6165 declares = [x for x in result .stderr .split ("\n " ) if x .startswith ("declare" )]
6266 assert 'declare -x FOO="{}"' .format (ts ) in declares
6367 assert 'declare -x BAR="baz"' in declares
You can’t perform that action at this time.
0 commit comments