Skip to content

Commit

Permalink
Merge pull request #32 from NASA-Openscapes/vscode-extensions
Browse files Browse the repository at this point in the history
Install vscode extensions, attempt #3
  • Loading branch information
betolink authored Jun 20, 2024
2 parents 253f4a5 + ff83d03 commit 66340e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
7 changes: 1 addition & 6 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ COPY --chown=jovyan:jovyan . /home/jovyan/.kernels
USER root

ENV QUARTO_CLI=https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.433/quarto-1.3.433-linux-amd64.deb

ENV VSCODE_EXT_DIR=/opt/code-server/extensions
RUN mkdir -p ${VSCODE_EXT_DIR} && chown -R ${NB_USER}: ${VSCODE_EXT_DIR}

RUN wget -O /tmp/quarto.deb ${QUARTO_CLI} && dpkg -i /tmp/quarto.deb && rm -rf /tmp/quarto.deb && apt-get clean

Expand All @@ -19,9 +16,7 @@ WORKDIR ${HOME}/.kernels

RUN chmod +x install-kernels.sh && cd /home/jovyan/.kernels && ./install-kernels.sh environments

RUN echo "extensions-dir: $VSCODE_EXT_DIR" >> $HOME/.config/code-server/config.yaml && \
EXT_LIST="ms-python.python quarto.quarto" && \
for EXT in $EXT_LIST; do code-server --install-extension $EXT; done
RUN chmod +x install-vscode-ext.sh && ./install-vscode-ext.sh vscode-extensions.txt

ENV JUPYTERHUB_HTTP_REFERER=https://openscapes.2i2c.cloud/

15 changes: 15 additions & 0 deletions ci/install-vscode-ext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Install VSCode extensions.
# These get installed to $CONDA_PREFIX/envs/notebook/share/code-server/extensions/

ext_file="$1"

echo "Checking for '$ext_file'..."

if test -f "$ext_file"
then
for EXT in $(cat "$ext_file")
do code-server --install-extension $EXT
done
fi
3 changes: 3 additions & 0 deletions ci/vscode-extensions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ms-python.python
ms-toolsai.jupyter
quarto.quarto

0 comments on commit 66340e0

Please sign in to comment.