diff --git a/workshop-images/base-environment/opt/eduk8s/etc/profile.d/02-exercises.sh b/workshop-images/base-environment/opt/eduk8s/etc/profile.d/02-exercises.sh deleted file mode 100644 index dee95424..00000000 --- a/workshop-images/base-environment/opt/eduk8s/etc/profile.d/02-exercises.sh +++ /dev/null @@ -1,13 +0,0 @@ -# Set the working directory for workshop exercises. The working directory for -# the editor and terminal will be changed to this directory so any extra files -# and directories in the home directory are not as visible. - -EXERCISES_DIR=${EXERCISES_DIR:-exercises} - -if [ -d $HOME/$EXERCISES_DIR ]; then - TERMINAL_HOME=$HOME/$EXERCISES_DIR - export TERMINAL_HOME - - EDITOR_HOME=$HOME/$EXERCISES_DIR - export EDITOR_HOME -fi diff --git a/workshop-images/base-environment/opt/eduk8s/sbin/start-editor b/workshop-images/base-environment/opt/eduk8s/sbin/start-editor index e5dec18a..59446236 100755 --- a/workshop-images/base-environment/opt/eduk8s/sbin/start-editor +++ b/workshop-images/base-environment/opt/eduk8s/sbin/start-editor @@ -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 \ diff --git a/workshop-images/base-environment/opt/eduk8s/sbin/start-gateway b/workshop-images/base-environment/opt/eduk8s/sbin/start-gateway index 0b4f6865..ca8a64cf 100755 --- a/workshop-images/base-environment/opt/eduk8s/sbin/start-gateway +++ b/workshop-images/base-environment/opt/eduk8s/sbin/start-gateway @@ -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 diff --git a/workshop-images/conda-environment/start-jupyterlab.sh b/workshop-images/conda-environment/start-jupyterlab.sh index 6e559670..7b6c07b9 100755 --- a/workshop-images/conda-environment/start-jupyterlab.sh +++ b/workshop-images/conda-environment/start-jupyterlab.sh @@ -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