Skip to content

Commit

Permalink
Move calculation of terminal and editor home until just before runnin…
Browse files Browse the repository at this point in the history
…g services.
  • Loading branch information
GrahamDumpleton committed Apr 27, 2022
1 parent bb5ccb8 commit 0b51df1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.

This file was deleted.

8 changes: 8 additions & 0 deletions workshop-images/base-environment/opt/eduk8s/sbin/start-editor
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ set -eo pipefail

CODE_SERVER_BIND_ADDRESS=${CODE_SERVER_BIND_ADDRESS:-127.0.0.1}

EXERCISES_DIR=${EXERCISES_DIR:-exercises}

if [ -d $HOME/$EXERCISES_DIR ]; then
EDITOR_HOME=$HOME/$EXERCISES_DIR
fi

EDITOR_HOME=${EDITOR_HOME:-$HOME}

export EDITOR_HOME

exec /opt/editor/bin/code-server \
--bind-addr "$CODE_SERVER_BIND_ADDRESS:10085" \
--auth none \
Expand Down
10 changes: 10 additions & 0 deletions workshop-images/base-environment/opt/eduk8s/sbin/start-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ export XDG_CONFIG_HOME
TERMINAL_LAYOUT=${TERMINAL_LAYOUT=`workshop-definition -r '(.spec.session.applications.terminal.layout // "default")'`}
export TERMINAL_LAYOUT

EXERCISES_DIR=${EXERCISES_DIR:-exercises}

if [ -d $HOME/$EXERCISES_DIR ]; then
TERMINAL_HOME=$HOME/$EXERCISES_DIR
fi

TERMINAL_HOME=${TERMINAL_HOME:-$HOME}

export TERMINAL_HOME

cd /opt/gateway

NODE_PATH=`pwd`/node_modules
Expand Down
12 changes: 10 additions & 2 deletions workshop-images/conda-environment/start-jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ else
conda activate base
fi

if [ x"$TERMINAL_HOME" != x"" ]; then
cd $TERMINAL_HOME
EXERCISES_DIR=${EXERCISES_DIR:-exercises}

if [ -d $HOME/$EXERCISES_DIR ]; then
TERMINAL_HOME=$HOME/$EXERCISES_DIR
fi

TERMINAL_HOME=${TERMINAL_HOME:-$HOME}

export TERMINAL_HOME

cd $TERMINAL_HOME

exec jupyter lab --ip 0.0.0.0 --port 8888

0 comments on commit 0b51df1

Please sign in to comment.