From be1a9f40a2057d520a656451f06ac645242be2ce Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 16 Oct 2023 15:38:41 +0100 Subject: [PATCH] build: change devcontainer --- ...ed-devcontainer.json => devcontainer.json} | 10 ++++---- .devcontainer/post-install.sh | 3 --- .devcontainer/recommended-Dockerfile | 9 ------- .gitignore | 3 +-- docs/contribute/devcontainer.rst | 25 ++++++------------- docs/contribute/devcycle.rst | 2 +- 6 files changed, 15 insertions(+), 37 deletions(-) rename .devcontainer/{recommended-devcontainer.json => devcontainer.json} (82%) delete mode 100644 .devcontainer/recommended-Dockerfile diff --git a/.devcontainer/recommended-devcontainer.json b/.devcontainer/devcontainer.json similarity index 82% rename from .devcontainer/recommended-devcontainer.json rename to .devcontainer/devcontainer.json index fe45a2db..105e507b 100644 --- a/.devcontainer/recommended-devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ { "name": "Atomic Calendar Revive", - "dockerFile": "Dockerfile", - "context": "..", + "image": "totaldebug/bugbox:typescript", + "postCreateCommand": "zsh ./.devcontainer/post-install.sh", "customizations": { "vscode": { "settings": { @@ -24,9 +24,9 @@ "ms-python.python", "tht13.html-preview-vscode", "sourcery.sourcery", - "tabnine.tabnine-vscode" + "tabnine.tabnine-vscode", + "trond-snekvik.simple-rst" ] } - }, - "postCreateCommand": "zsh ./.devcontainer/post-install.sh" + } } diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh index 7b77fef4..2cb244dc 100644 --- a/.devcontainer/post-install.sh +++ b/.devcontainer/post-install.sh @@ -7,9 +7,6 @@ WORKSPACE_DIR=$(pwd) # Now install all dependencies yarn install -# Install Commitizen globally -npm install commitizen -g - # Install documentation dependencies pip3 install -r docs/requirements.txt pip3 install sphinx-autobuild pre-commit diff --git a/.devcontainer/recommended-Dockerfile b/.devcontainer/recommended-Dockerfile deleted file mode 100644 index 554f4406..00000000 --- a/.devcontainer/recommended-Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye - -RUN apt update && apt upgrade -y - -RUN apt install -y zsh python3 python3-sphinx python3-pip - -RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | zsh || true - -CMD ["zsh"] diff --git a/.gitignore b/.gitignore index f370872c..76831391 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,7 @@ dist/* !dist/atomic-calendar-revive.js .devcontainer/* -!.devcontainer/recommended-devcontainer.json -!.devcontainer/recommended-Dockerfile +!.devcontainer/devcontainer.json !.devcontainer/post-install.sh dist diff --git a/docs/contribute/devcontainer.rst b/docs/contribute/devcontainer.rst index 629ce74f..c6f06d19 100644 --- a/docs/contribute/devcontainer.rst +++ b/docs/contribute/devcontainer.rst @@ -13,25 +13,16 @@ Requirements * VS Code * Docker -* Remote - Containers (VS Code extension) +* Remote Development (VS Code extension pack) -************* -Configuration -************* +***** +Usage +***** -#. Copy the files inside ``.devcontainer`` -#. Paste them in the same folder, renaming to remove the ``recommended-`` -#. In most cases no other changes will be required with these files +#. Open VS Code +#. Open the command pallete and type: ``Dev Continers: Clone repository in container volume`` -.. note:: - Please ensure that the ``recommended-xxx`` files are not removed as this would remove - them from the repository +This will then clone the repository directly into the development container and install +all the recommended plugins. You can then start development without any further configuration -When you open the repository with VS Code, a prompt to "Reopen in container" should -now appear. This will start the build of the development container with all components -and extensions pre-installed. - -.. note:: - If you don't see the notification, open the command pallet and select - ``Remote-Containers: Open Folder in Container`` diff --git a/docs/contribute/devcycle.rst b/docs/contribute/devcycle.rst index 05e18869..28469571 100644 --- a/docs/contribute/devcycle.rst +++ b/docs/contribute/devcycle.rst @@ -10,7 +10,7 @@ Setup Repository **************** * Fork the repo in `github `_ -* Clone the project to your development machine +* Clone the project to your development machine (or follow the DevContainer instructions) .. code-block:: bash