Skip to content

Commit 3782dd7

Browse files
remyleoneCopilot
andauthored
feat: add support for devcontainers (#5366)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a657c81 commit 3782dd7

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ARG VARIANT="dev-1.26-bookworm"
2+
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}

.devcontainer/devcontainer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/go
3+
{
4+
"name": "Go",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17
9+
// Append -bullseye or -buster to pin to an OS version.
10+
// Use -bullseye variants on local arm64/Apple Silicon.
11+
"VARIANT": "dev-1.26-bookworm",
12+
// Options
13+
"NODE_VERSION": "none"
14+
}
15+
},
16+
// Note: Avoid elevated container privileges by default, especially in CI.
17+
// If you *must* enable debugging that requires ptrace locally, you can
18+
// temporarily add:
19+
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
20+
21+
// Set *default* container specific settings.json values on container create.
22+
"settings": {
23+
"go.toolsManagement.checkForUpdates": "local",
24+
"go.useLanguageServer": true,
25+
"go.gopath": "/go"
26+
},
27+
28+
// Add the IDs of extensions you want installed when the container is created.
29+
"extensions": [
30+
"golang.Go"
31+
],
32+
"containerEnv": {
33+
// Access key of a token
34+
"SCW_ACCESS_KEY": "${localEnv:SCW_ACCESS_KEY}",
35+
// Secret key of a token
36+
"SCW_SECRET_KEY": "${localEnv:SCW_SECRET_KEY}",
37+
// Url of the API
38+
//"SCW_API_URL": "${localEnv:SCW_API_URL}",
39+
// Your default availability zone (fr-par-1, nl-ams-1, ...)
40+
//"SCW_DEFAULT_ZONE": "${localEnv:SCW_DEFAULT_ZONE}",
41+
// Your default region (fr-par, nl-ams, ...)
42+
//"SCW_DEFAULT_REGION": "${localEnv:SCW_DEFAULT_REGION}",
43+
// Your default project ID
44+
"SCW_DEFAULT_PROJECT_ID": "${localEnv:SCW_DEFAULT_PROJECT_ID}",
45+
// Your default organization ID
46+
"SCW_DEFAULT_ORGANIZATION_ID": "${localEnv:SCW_DEFAULT_ORGANIZATION_ID}"
47+
},
48+
49+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
50+
// "forwardPorts": [],
51+
52+
// Use 'postCreateCommand' to run commands after the container is created.
53+
// "postCreateCommand": "go version",
54+
55+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
56+
"remoteUser": "vscode"
57+
}

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ updates:
2727
directory: "/wasm"
2828
schedule:
2929
interval: monthly
30+
31+
- package-ecosystem: devcontainers
32+
directory: "/"
33+
schedule:
34+
interval: monthly

.github/workflows/devcontainer.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Dev Container Check
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
merge_group:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
17+
- name: Build and Run Dev Container
18+
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 # v0.3.1900000417
19+
with:
20+
runCmd: go run ./cmd/scw --help

0 commit comments

Comments
 (0)