-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add devcontainer and vscode launch configurations (#128)
- Loading branch information
Showing
6 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Based on microsoft go devcontainer - https://github.com/microsoft/vscode-dev-containers/blob/v0.205.2/containers/go/.devcontainer/Dockerfile | ||
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster | ||
ARG VARIANT=1-bullseye | ||
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT} | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="none" | ||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends protobuf-compiler | ||
|
||
USER vscode | ||
|
||
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \ | ||
&& go install github.com/bufbuild/buf/cmd/[email protected] \ | ||
&& go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest \ | ||
&& go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \ | ||
&& go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest \ | ||
&& go install github.com/GeertJohan/go.rice/rice@latest \ | ||
&& go install github.com/goreleaser/goreleaser@latest \ | ||
&& npm install -g @bufbuild/protoc-gen-es @connectrpc/protoc-gen-connect-es |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "Go", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local arm64/Apple Silicon. | ||
"VARIANT": "1-1.21-bookworm", | ||
// Options | ||
"NODE_VERSION": "lts/*" | ||
} | ||
}, | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"go.toolsManagement.checkForUpdates": "local", | ||
"go.useLanguageServer": true, | ||
"go.gopath": "/go", | ||
"go.goroot": "/usr/local/go", | ||
"typescript.tsdk": "webui/node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"gitlens.telemetry.enabled": false | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"golang.Go", | ||
"ms-azuretools.vscode-docker", | ||
"mhutchie.git-graph", | ||
"eamodio.gitlens", | ||
"donjayamanne.githistory", | ||
"esbenp.prettier-vscode", | ||
"iulian-radu-at.vscode-tasks-sidebar" | ||
] | ||
} | ||
}, | ||
// 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": "go version", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
backrest | ||
backrest-* | ||
dist | ||
backrest.exe | ||
backrest.exe | ||
__debug_bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Go backend", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"program": "${workspaceFolder}/backrest.go", | ||
"output": "__debug_bin", | ||
"preLaunchTask": "Build Webui", | ||
}, | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"preLaunchTask": "Parcel", | ||
"postDebugTask": "Terminate Parcel", | ||
"name": "Debug TS frontend", | ||
"url": "http://localhost:1234", | ||
"webRoot": "${workspaceFolder}/webui/src/", | ||
"sourceMapPathOverrides": { | ||
"../*": "${webRoot}/*" | ||
} | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Debug Backrest (backend+frontend)", | ||
"configurations": [ | ||
"Debug Go backend", | ||
"Debug TS frontend" | ||
], | ||
"stopAll": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "npm i", | ||
"type": "shell", | ||
"command": "cd webui && npm i", | ||
}, | ||
{ | ||
"label": "Parcel", | ||
"type": "npm", | ||
"script": "start", | ||
"dependsOn": "npm i", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": "parcel serve", | ||
"endsPattern": "Built in" | ||
}, | ||
"pattern": { | ||
"regexp": ".*" | ||
} | ||
}, | ||
"path": "webui" | ||
}, | ||
{ | ||
"label": "Build Webui", | ||
"type": "npm", | ||
"script": "build", | ||
"path": "webui", | ||
"group": "build", | ||
"problemMatcher": [], | ||
"dependsOn": "npm i" | ||
}, | ||
{ | ||
"label": "Terminate Parcel", | ||
"command": "echo ${input:terminate}", | ||
"type": "shell", | ||
"problemMatcher": [] | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "terminate", | ||
"type": "command", | ||
"command": "workbench.action.tasks.terminate", | ||
"args": "Parcel" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters