Create devcontainer configuration (#6479)

* 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>
This commit is contained in:
Spenser Black 2023-09-07 09:27:13 -04:00 коммит произвёл GitHub
Родитель 9b634a089f
Коммит 826cc7dbf6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 36 добавлений и 0 удалений

3
.devcontainer/Dockerfile Normal file
Просмотреть файл

@ -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

Просмотреть файл

@ -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
.devcontainer/postCreate.sh Executable file
Просмотреть файл

@ -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
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
# Fix syntax highlighting for devcontainer files
.devcontainer/*.json linguist-language=JSON-with-Comments