From 3e33579947cf06dd33aa6e6b50fcff99443741b5 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Sat, 20 Jun 2020 11:38:56 +0900 Subject: [PATCH 1/2] chore: Add vscode devcontainer --- .devcontainer/devcontainer.json | 29 +++++++++++++++++++++++++++++ .gitignore | 1 + .vscode/extensions.json | 19 +++++++++++++++++++ .vscode/launch.json | 15 +++++++++++++++ .vscode/settings.json | 3 --- 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..3b1cca8b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "Node", + "build": { + "dockerfile": "../Dockerfile", + "context": "..", + "args": { + "NODE_VERSION": "12.18.1" + } + }, + + // 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": [ + "editorconfig.editorconfig" + ], + + // 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": "npm ci", + + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode" +} diff --git a/.gitignore b/.gitignore index 20294dd4..e5d1c351 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ coverage .eslintcache .env node_modules +.vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..d1266a2a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,19 @@ +{ + "recommendations": [ + "ms-vscode-remote.vscode-remote-extensionpack", + "ms-azuretools.vscode-docker", + "bungcip.better-toml", + "editorconfig.editorconfig", + "lfs.vscode-emacs-friendly", + "donjayamanne.githistory", + "github.vscode-pull-request-github", + "eamodio.gitlens", + "oderwat.indent-rainbow", + "yzhang.markdown-all-in-one", + "shd101wyy.markdown-preview-enhanced", + "christian-kohler.path-intellisense", + "satokaz.vscode-bs-ctrlchar-remover", + "visualstudioexptteam.vscodeintellicode", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..a56ebf34 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // 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.1.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Node (Integrated Terminal)", + "program": "${workspaceFolder}/src/index.ts", + "console": "integratedTerminal" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3b664107..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "git.ignoreLimitWarning": true -} \ No newline at end of file From 18c640015beb975f00071e55a519bbd406413da6 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Sun, 21 Jun 2020 12:58:55 +0900 Subject: [PATCH 2/2] fix --- .devcontainer/devcontainer.json | 9 +++++++-- Dockerfile | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3b1cca8b..2fe4bd81 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,8 +22,13 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm ci", + // "postCreateCommand": "npm ci", // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - // "remoteUser": "vscode" + // "remoteUser": "vscode", + + // Developing inside a container on a remote Docker host + // https://code.visualstudio.com/docs/remote/containers-advanced#_developing-inside-a-container-on-a-remote-docker-host + "workspaceFolder": "/workspace", + "workspaceMount": "source=/home/iris/Documents/repos/github.com/peaceiris/actions-hugo,target=/workspace,type=volume" } diff --git a/Dockerfile b/Dockerfile index 3717109f..7396f5ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \ make all && \ make install -WORKDIR /repo +WORKDIR /workspace ENV RUNNER_TEMP="/tmp" CMD [ "bash" ]