From bf0126122caec3b65557dfd38dbf5339e05f4844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= Date: Fri, 19 Feb 2021 09:05:09 +0100 Subject: [PATCH] Add vscode devcontainer / testing setup --- .devcontainer/Dockerfile | 19 ++++++++++++++++++ .devcontainer/devcontainer.json | 32 +++++++++++++++++++++++++++++++ .vscode/extensions.json | 5 +++++ .vscode/launch.json | 34 +++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..82ba4822 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/ruby/.devcontainer/base.Dockerfile + +# [Choice] Ruby version: 2, 2.7, 2.6, 2.5 +ARG VARIANT="2" +FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} + +ENV DEBIAN_FRONTEND=noninteractive + +RUN \ + apt-get update \ + && \ + apt-get -y install --no-install-recommends \ + jq \ + libjq-dev \ + gnupg2 \ + && \ + sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin \ + && \ + curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | /bin/bash - diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..e664c344 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/ruby +{ + "name": "Ruby", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update 'VARIANT' to pick a Ruby version: 2, 2.7, 2.6, 2.5 + "VARIANT": "2.7", + } + }, + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-kubernetes-tools.vscode-kubernetes-tools", + "rebornix.Ruby" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "export RUBYJQ_USE_SYSTEM_LIBRARIES=1 && bundle install", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..43321cdc --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-vscode-remote.remote-containers" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..d0f54369 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "UnitTest - active spec file only", + "type": "Ruby", + "request": "launch", + "cwd": "${workspaceRoot}", + "program": "/usr/local/bin/bundle", + "args": [ + "exec", + "m", + "-r", + "${relativeFile}" + ] + }, + { + "name": "UnitTest - all spec files", + "type": "Ruby", + "request": "launch", + "cwd": "${workspaceRoot}", + "program": "/usr/local/bin/bundle", + "args": [ + "exec", + "m", + "-r", + "${workspaceFolder}/test/charts" + ] + } + ] +}