From 7a78dcb339374fc4c31a65faf51c5311cf8f8dd2 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 20 Jul 2024 01:50:47 +0000 Subject: [PATCH] Reconfigured devcontainer. --- .devcontainer/Dockerfile | 9 ++--- .devcontainer/devcontainer.json | 34 ++++++++++++------- .vscode/settings.json | 11 +++--- Jenkinsfile | 2 +- .../environment.yml => environment.yml | 0 5 files changed, 31 insertions(+), 25 deletions(-) rename .devcontainer/environment.yml => environment.yml (100%) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2670317..2738918 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,16 +1,11 @@ -FROM mcr.microsoft.com/devcontainers/miniconda:1-3 +FROM mcr.microsoft.com/devcontainers/anaconda:1-3 # Copy environment.yml (if found) to a temp location so we update the environment. Also # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists. -COPY environment.yml* noop.txt /tmp/conda-tmp/ +COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/ RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ && rm -rf /tmp/conda-tmp -# [Optional] Uncomment to install a different version of Python than the default -# RUN conda install -y python=3.6 \ -# && pip install --no-cache-dir pipx \ -# && pipx reinstall-all - # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 53295bb..7f776ab 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,20 +2,30 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/debian { "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "build": { + "context": "..", "dockerfile": "Dockerfile" - } + }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, + "customizations": { + "vscode": { + "extensions": [ + "ms-dotnettools.vscode-dotnet-runtime", + "svelte.svelte-vscode", + "syler.sass-indented", + "dbaeumer.vscode-eslint", + "ms-dotnettools.csharp" + ], + "settings": { + "python.defaultInterpreterPath": "/opt/conda/bin/python", + "dotnet.dotnetPath": "/opt/conda/lib/dotnet/", + "omnisharp.dotNetCliPaths": [ + "/opt/conda/lib/dotnet/dotnet" + ] + } + } + }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + "postCreateCommand": "bash conda init" - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index e21f964..6d74b7c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { - "dotnet.dotnetPath": "/opt/conda/lib/dotnet/", - "omnisharp.dotNetCliPaths": [ - "/opt/conda/lib/dotnet/dotnet" - ] -} \ No newline at end of file + "python.defaultInterpreterPath": "/opt/conda/bin/python", + "dotnet.dotnetPath": "/opt/conda/lib/dotnet/", + "omnisharp.dotNetCliPaths": [ + "/opt/conda/lib/dotnet/dotnet" + ] +} diff --git a/Jenkinsfile b/Jenkinsfile index 5c89e30..66207ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { stage("Install") { steps { sh 'conda update conda -y' - sh 'conda env update -n base --file .devcontainer/environment.yml' + sh 'conda env update -n base --file environment.yml' sh 'conda run -n base dotnet restore props.sln' sh 'npm install --prefix ./Props' } diff --git a/.devcontainer/environment.yml b/environment.yml similarity index 100% rename from .devcontainer/environment.yml rename to environment.yml