From e1e30bef3165658254e5c03023af4b8e004a6c5c Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Mon, 22 Dec 2025 13:55:26 -0500 Subject: [PATCH] Various fixes for devcontainer script 1. Get rid of template directory so all necessary devcontainer files are copied. The `devrd` script wasn't being copied when running setupcontainer. 2. Change links to reference everest-core instead of everest-dev-container. 3. Update vscode docs to make sure `./devrd env` is run. Opening the devcontainer in vscode fails if the .env file is missing. Signed-off-by: Aria Nolan --- applications/dev-environment/README.md | 10 ++++++- .../.devcontainer/devrd-completion.bash | 0 .../.devcontainer/devrd-completion.zsh | 0 .../.devcontainer/docker-compose.yml | 0 .../general-devcontainer/Dockerfile | 0 .../general-devcontainer/devcontainer.json | 0 .../docker-compose.devcontainer.yml | 0 .../.devcontainer/nodered-settings.js | 0 .../devcontainer/setup-container | 28 +++++++++---------- 9 files changed, 23 insertions(+), 15 deletions(-) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/devrd-completion.bash (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/devrd-completion.zsh (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/docker-compose.yml (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/general-devcontainer/Dockerfile (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/general-devcontainer/devcontainer.json (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml (100%) rename applications/dev-environment/devcontainer/{template => }/.devcontainer/nodered-settings.js (100%) diff --git a/applications/dev-environment/README.md b/applications/dev-environment/README.md index 132733fd17..743f4435d4 100644 --- a/applications/dev-environment/README.md +++ b/applications/dev-environment/README.md @@ -75,7 +75,15 @@ Here are the steps required: 2. **Version**: Press Enter to use 'main' (recommended) 3. **Continue if directory not empty**: Type 'y' and press Enter (since you downloaded the setup-container script) -3. **Open in VS Code:** +3. **Create .env file** + + Make sure your ssh agent is running and a key is added + + ```bash + ./devrd env + ``` + +4. **Open in VS Code:** Then open the workspace in Visual Studio Code: ```bash diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/devrd-completion.bash b/applications/dev-environment/devcontainer/.devcontainer/devrd-completion.bash similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/devrd-completion.bash rename to applications/dev-environment/devcontainer/.devcontainer/devrd-completion.bash diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/devrd-completion.zsh b/applications/dev-environment/devcontainer/.devcontainer/devrd-completion.zsh similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/devrd-completion.zsh rename to applications/dev-environment/devcontainer/.devcontainer/devrd-completion.zsh diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/docker-compose.yml b/applications/dev-environment/devcontainer/.devcontainer/docker-compose.yml similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/docker-compose.yml rename to applications/dev-environment/devcontainer/.devcontainer/docker-compose.yml diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile b/applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/Dockerfile similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile rename to applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/Dockerfile diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json b/applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/devcontainer.json similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json rename to applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/devcontainer.json diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml b/applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml rename to applications/dev-environment/devcontainer/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml diff --git a/applications/dev-environment/devcontainer/template/.devcontainer/nodered-settings.js b/applications/dev-environment/devcontainer/.devcontainer/nodered-settings.js similarity index 100% rename from applications/dev-environment/devcontainer/template/.devcontainer/nodered-settings.js rename to applications/dev-environment/devcontainer/.devcontainer/nodered-settings.js diff --git a/applications/dev-environment/devcontainer/setup-container b/applications/dev-environment/devcontainer/setup-container index 951c7776ea..1ac8563d99 100755 --- a/applications/dev-environment/devcontainer/setup-container +++ b/applications/dev-environment/devcontainer/setup-container @@ -13,7 +13,7 @@ install_devcontainer() { fi WORKSPACE_DIR=$(realpath -m "$WORKSPACE_DIR") - read -p "Enter the version of the everest-dev-environment (default is 'main'): " VERSION + read -p "Enter the version of the everest-core (default is 'main'): " VERSION if [ -z "$VERSION" ]; then VERSION="main" fi @@ -21,10 +21,10 @@ install_devcontainer() { echo "Create the workspace directory '$WORKSPACE_DIR' if it does not exist" mkdir -p $WORKSPACE_DIR - # Check if workspace directory has files other than everest-dev-environment - WORKSPACE_CONTENTS=$(ls -A $WORKSPACE_DIR 2>/dev/null | grep -v "^everest-dev-environment$" || true) + # Check if workspace directory has files other than everest-core + WORKSPACE_CONTENTS=$(ls -A $WORKSPACE_DIR 2>/dev/null | grep -v "^everest-core$" || true) if [ -n "$WORKSPACE_CONTENTS" ]; then - # The workspace directory is not empty (excluding everest-dev-environment), warning do you want to continue? + # The workspace directory is not empty (excluding everest-core), warning do you want to continue? read -p "The workspace directory is not empty, do you want to continue? (y/N): " -r case "$REPLY" in [Nn]|"") @@ -40,19 +40,19 @@ install_devcontainer() { esac fi - # Check if everest-dev-environment exists locally - if [ -d "everest-dev-environment" ]; then - echo "Found local everest-dev-environment directory, using it instead of cloning..." - SOURCE_DIR="everest-dev-environment" + # Check if everest-core exists locally + if [ -d "everest-core" ]; then + echo "Found local everest-core directory, using it instead of cloning..." + SOURCE_DIR="everest-core" else - echo "No local everest-dev-environment found, cloning from GitHub..." + echo "No local everest-core found, cloning from GitHub..." TMP_DIR=$(mktemp --directory) - git clone --quiet --depth 1 --single-branch --branch "$VERSION" https://github.com/EVerest/everest-dev-environment.git "$TMP_DIR" + git clone --quiet --depth 1 --single-branch --branch "$VERSION" https://github.com/EVerest/everest-core.git "$TMP_DIR" SOURCE_DIR="$TMP_DIR" fi echo "Copy the template devcontainer configuration files to the workspace directory" - cp -n -r $SOURCE_DIR/devcontainer/template/. $WORKSPACE_DIR/ + cp -n -r $SOURCE_DIR/applications/dev-environment/devcontainer/. $WORKSPACE_DIR/ # Ensure devrd script is executable if [ -f "$WORKSPACE_DIR/devrd" ]; then @@ -63,8 +63,8 @@ install_devcontainer() { fi # Only remove temporary directory if we cloned it - if [ "$SOURCE_DIR" != "everest-dev-environment" ]; then - echo "Remove the temporary everest-dev-environment repository" + if [ "$SOURCE_DIR" != "everest-core" ]; then + echo "Remove the temporary everest-core repository" rm -rf "$SOURCE_DIR" fi @@ -138,4 +138,4 @@ while [ $# -gt 0 ]; do done # Execute the installation -install_devcontainer \ No newline at end of file +install_devcontainer