From 3be072541eca67c562b4ac3ce18db8dc35b7e043 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Tue, 22 Oct 2024 10:22:03 +0530 Subject: [PATCH] feat: add nvim-java template --- .github/workflows/test-pr.yaml | 2 +- README.md | 123 +----------------- src/hello/.devcontainer/devcontainer.json | 21 --- src/hello/devcontainer-template.json | 34 ----- .../.devcontainer/Dockerfile | 0 src/nvim-java/.devcontainer/devcontainer.json | 24 ++++ src/nvim-java/devcontainer-template.json | 34 +++++ test/{hello => nvim-java}/test.sh | 0 8 files changed, 60 insertions(+), 178 deletions(-) delete mode 100644 src/hello/.devcontainer/devcontainer.json delete mode 100644 src/hello/devcontainer-template.json rename src/{hello => nvim-java}/.devcontainer/Dockerfile (100%) create mode 100644 src/nvim-java/.devcontainer/devcontainer.json create mode 100644 src/nvim-java/devcontainer-template.json rename test/{hello => nvim-java}/test.sh (100%) diff --git a/.github/workflows/test-pr.yaml b/.github/workflows/test-pr.yaml index 778bed4..0c0091a 100644 --- a/.github/workflows/test-pr.yaml +++ b/.github/workflows/test-pr.yaml @@ -13,7 +13,7 @@ jobs: with: filters: | color: ./**/color/** - hello: ./**/hello/** + nvim-java: ./**/nvim-java/** test: needs: [detect-changes] diff --git a/README.md b/README.md index 974ac6d..23c40c0 100644 --- a/README.md +++ b/README.md @@ -1,122 +1 @@ -# Dev Container Templates: Self Authoring Guide - -> This repo provides a starting point and example for creating your own custom [Dev Container Templates](https://containers.dev/implementors/templates), hosted for free on GitHub Container Registry. The example in this repository follows the [Dev Container Template distribution specification](https://containers.dev/implementors/templates-distribution/). -> -> To provide feedback on the distribution spec, please leave a comment [on spec issue #71](https://github.com/devcontainers/spec/issues/71). - -## Repo and Template Structure - -This repository contains a _collection_ of two Templates - `hello` and `color`. These Templates serve as simple template implementations which helps containerize the project. Similar to the [`devcontainers/templates`](https://github.com/devcontainers/templates) repo, this repository has a `src` folder. Each Template has its own sub-folder, containing at least a `devcontainer-template.json` and `.devcontainer/devcontainer.json`. - -``` -├── src -│ ├── color -│ │ ├── devcontainer-template.json -│ │ └──| .devcontainer -│ │ └── devcontainer.json -│ ├── hello -│ │ ├── devcontainer-template.json -│ │ └──| .devcontainer -│ │ ├── devcontainer.json -│ │ └── Dockerfile -| ├── ... -│ │ ├── devcontainer-template.json -│ │ └──| .devcontainer -│ │ └── devcontainer.json -├── test -│ ├── color -│ │ └── test.sh -│ ├── hello -│ │ └── test.sh -│ └──test-utils -│ └── test-utils.sh -... -``` - -### Options - -All available options for a Template should be declared in the `devcontainer-template.json`. The syntax for the `options` property can be found in the [devcontainer Template json properties reference](https://containers.dev/implementors/templates#devcontainer-templatejson-properties). - -For example, the `color` Template provides three possible options (`red`, `gold`, `green`), where the default value is set to "red". - -```jsonc -{ - // ... - "options": { - "favorite": { - "type": "string", - "description": "Choose your favorite color." - "proposals": [ - "red", - "gold", - "green" - ], - "default": "red" - } - } -} -``` - -An [implementing tool](https://containers.dev/supporting#tools) will use the `options` property from [the documented Dev Container Template properties](https://containers.dev/implementors/templates#devcontainer-templatejson-properties) for customizing the Template. See [option resolution example](https://containers.dev/implementors/templates#option-resolution-example) for details. - -## Distributing Templates - -**Note**: *Allow GitHub Actions to create and approve pull requests* should be enabled in the repository's `Settings > Actions > General > Workflow permissions` for auto generation of `src/