Skip to content

Commit

Permalink
Create devcontainer configuration (#6479)
Browse files Browse the repository at this point in the history
* Add basic devcontainer config

* Use Dockerfile for devcontainer

This is to install additional dependencies that don't come with base
image.

* Fetch test references

These references are necessary for tests to work properly.

* Depluralize

* Add YAML VSCode extension

Most peeps will be editing the YAML files so lets ensure a better experience

* Move bootstrap to onCreateCommand

This will allow the bootstrapping to be cached in the prebuild and save users a lot of time

* Make arrays multi-line

Co-authored-by: John Gardner <gardnerjohng@gmail.com>

---------

Co-authored-by: Colin Seymour <colin@symr.io>
Co-authored-by: Colin Seymour <colin@github.com>
Co-authored-by: John Gardner <gardnerjohng@gmail.com>
  • Loading branch information
4 people authored Sep 7, 2023
1 parent 9b634a0 commit 826cc7d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Available versions: https://github.com/devcontainers/images/tree/main/src/ruby
FROM mcr.microsoft.com/devcontainers/ruby
RUN apt update && apt install -y cmake
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Ruby",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/go:1": {}
},
"customizations": {
"codespaces": {
"openFiles": [
"CONTRIBUTING.md",
"lib/linguist/languages.yml"
]
},
"vscode": {
"extensions": [
"EditorConfig.EditorConfig",
"rebornix.Ruby",
"redhat.vscode-yaml"
]
}
},
"onCreateCommand": "./script/bootstrap",
"postCreateCommand": ".devcontainer/postCreate.sh",
"remoteUser": "vscode"
}
3 changes: 3 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
git remote add linguist https://github.com/github-linguist/linguist
git fetch linguist v2.0.0:v2.0.0 test/attributes:test/attributes test/master:test/master
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Fix syntax highlighting for devcontainer files
.devcontainer/*.json linguist-language=JSON-with-Comments

0 comments on commit 826cc7d

Please sign in to comment.