diff --git a/.devcontainer/.gitignore b/.devcontainer/.gitignore new file mode 100644 index 0000000000..8ab6b2d9a0 --- /dev/null +++ b/.devcontainer/.gitignore @@ -0,0 +1,2 @@ +# User-specific devcontainer directory with merged personal preferences +user/ diff --git a/.devcontainer/devenv.yaml b/.devcontainer/devenv.yaml new file mode 100644 index 0000000000..b97ecf9c91 --- /dev/null +++ b/.devcontainer/devenv.yaml @@ -0,0 +1,46 @@ +# Devenv project configuration +# Edit this file to configure your project's devcontainer +# and then run `devenv generate` to create the devcontainer.json files + +name: "cdk" + +# Modules: Built-in functionality +# - mise: Install and configure mise for dev tools management (https://mise.jdx.dev/) +# - docker-in-docker: Enable running Docker containers within the devcontainer +# - scala: Add IDE plugins and jar caching for Scala development +# - node: Add IDE plugins for Node.js development +# To disable, comment out or remove items from this list +modules: + - mise + # - docker-in-docker # (disabled by default) + # - scala # (disabled by default) + - node # (disabled by default) + +# Optional: Container image to use (defaults to latest ubuntu LTS) +# image: "mcr.microsoft.com/devcontainers/base:ubuntu" + +# Optional: Ports to forward +# forwardPorts: +# - 8080 # same port on host and container +# - "8000:9000" # hostPort:containerPort + +# Optional: Mount directories from host to container +# mounts: +# - "source=${localEnv: HOME}/.gu/example,target=/home/vscode/.gu/example,readonly,type=bind,consistency=cached" + +# Optional: IDE plugins - shared project plugins like language support +# plugins: +# vscode: [] +# intellij: [] + +# Optional: Commands to run after container creation +# Each command has a 'cmd' field and a 'workingDirectory' field +# e.g. +# postCreateCommand: +# - cmd: "npm install" +# workingDirectory: "." +# - cmd: "make setup" +# workingDirectory: "/workspaces/project" +# postStartCommand: +# - cmd: "echo 'Container started successfully'" +# workingDirectory: "." diff --git a/.devcontainer/shared/devcontainer.json b/.devcontainer/shared/devcontainer.json new file mode 100644 index 0000000000..1484a7a78b --- /dev/null +++ b/.devcontainer/shared/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name" : "cdk", + "image" : "mcr.microsoft.com/devcontainers/base:ubuntu", + "customizations" : { + "vscode" : { + "extensions" : [ + "hverlin.mise-vscode" + ] + }, + "jetbrains" : { + "plugins" : [ + "com.github.l34130.mise", + "NodeJS" + ] + } + }, + "forwardPorts" : [ + ], + "mounts" : [ + { + "source" : "devenv-mise-data-volume", + "target" : "/mnt/mise-data", + "type" : "volume" + } + ], + "containerEnv" : { + "MISE_DATA_DIR" : "/mnt/mise-data", + "MISE_INSTALL_PATH" : "/mnt/mise-data/mise" + }, + "remoteEnv" : { + "PATH" : "${containerEnv:PATH}:/mnt/mise-data/shims" + }, + "postCreateCommand" : "((cd . && bash -c ' echo -e \"\\033[1;34m[setup] Setting up mise.\\033[0m\" && echo -e \"\\033[1;34m[setup] ensure correct ownership of the shared mise data volume\\033[0m\" && sudo chown -R vscode:vscode /mnt/mise-data && echo -e \"\\033[1;34m[setup] checking for mise already present\\033[0m\" && (test -f $MISE_INSTALL_PATH && echo -e \"\\033[1;34m[setup] mise is present\\033[0m\") || (echo -e \"\\033[1;34m[setup] Installing mise...\\033[0m\" && curl -fsSL https://mise.run/bash | sh) && echo -e \"\\033[1;34m[setup] Symlinking $MISE_INSTALL_PATH to /usr/local/bin/mise...\\033[0m\" && sudo ln -sf $MISE_INSTALL_PATH /usr/local/bin/mise && echo -e \"\\033[1;34m[setup] checking mise working correctly\\033[0m\" && mise --version && echo -e \"\\033[1;34m[setup] updating mise if needed\\033[0m\" && (mise self-update --yes || echo \"Skipping mise self-update - you may be offline\") && echo -e \"\\033[1;34m[setup] trusting (See: https://mise.jdx.dev/cli/trust.html)\\033[0m\" && (mise trust --yes || true) && (mise install || echo -e \"\\033[1;33m[setup] mise install failed. You may need to run mise install manually inside the container.\\033[0m\") && echo -e \"\\033[1;34m[setup] final checks\\033[0m\" && export PATH=\"/mnt/mise-data/shims:$PATH\" && mise doctor && echo -e \"\\033[1;32m[setup] mise setup complete at $MISE_INSTALL_PATH.\\033[0m\" ')) | sudo tee /var/log/post-create.log" +} \ No newline at end of file