Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.17.0",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c",
"integrity": "sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c"
}
}
}
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"image": "mcr.microsoft.com/devcontainers/javascript-node:3-22",
"customizations": {
"vscode": {
"settings": {
"json.schemas": [
{
"fileMatch": [
"*/devcontainer-feature.json"
],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
},
"extensions": [
"mads-hartmann.bash-ide-vscode"
]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "npm install -g @devcontainers/cli"
}
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Release dev container features & Generate Documentation"
on:
workflow_dispatch:

jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
packages: write
steps:
- uses: actions/checkout@v7

- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create PR for Documentation
id: push_image_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git config pull.rebase false
branch=automated-documentation-update-$GITHUB_RUN_ID
git checkout -b $branch
message='Automated documentation update'
# Add / update and commit
git add */**/README.md
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
gh pr create --title "$message" --body "$message"
fi
56 changes: 56 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "CI - Test Features"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test-autogenerated:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
features:
- dsc
baseImage:
- debian:latest
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:ubuntu
steps:
- uses: actions/checkout@v7

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .

test-scenarios:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
features:
- dsc
steps:
- uses: actions/checkout@v7

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Generating tests for '${{ matrix.features }}' scenarios"
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated .

test-global:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v7

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Testing global scenarios"
run: devcontainer features test --global-scenarios-only .
16 changes: 16 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Validate devcontainer-feature.json files"
on:
workflow_dispatch:
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: "Validate devcontainer-feature.json files"
uses: devcontainers/action@v1
with:
validate-only: "true"
base-path-to-features: "./src"
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
# devcontainer-featuers
# devcontainer-features

A collection of dev container features for development environments. This repository maintains reusable features that can be integrated into dev containers for enhanced development tooling.

## Features

### Microsoft Desired State Configuration (DSC)

Installs Microsoft Desired State Configuration (DSC) v3, a cross-platform, open-source configuration management tool.

**Location:** [`src/dsc/`](src/dsc/)

**Features:**
- Cross-platform support (Windows, macOS, Linux)
- Schema-driven configuration management
- Written in Rust (no PowerShell dependency required)
- 30+ built-in resources for managing system configuration

**Supported Versions:**
- `latest` (default) - Latest stable release
- `preview` - Latest preview release
- `3.2.3`, `3.2.2`, `3.2.1`, `3.2.0` - Specific versions
- `none` - Skip installation

**Example Usage:**
```json
{
"features": {
"ghcr.io/PowerShell/devcontainer-features/dsc:1": {
"version": "latest"
}
}
}
```

For more details, see the [DSC Feature README](src/dsc/README.md).

## Testing

Each feature includes test scenarios to validate functionality:

```bash
npm install -g @devcontainers/cli
devcontainer features test -f dsc .
```

See [`test/dsc/scenarios.json`](test/dsc/scenarios.json) for available test scenarios.

## License

MIT License - See [LICENSE](LICENSE) for details.

40 changes: 40 additions & 0 deletions src/dsc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

# Microsoft Desired State Configuration (DSC) v3 (dsc)

Installs Microsoft Desired State Configuration (DSC) v3, a cross-platform, open-source configuration management tool. DSC v3 enables you to manage your infrastructure using configuration as code.

## Example Usage

```json
"features": {
"ghcr.io/PowerShell/devcontainer-features/dsc:1": {}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select or enter a version of Microsoft DSC to install. Use 'latest' for the latest version, 'none' to skip DSC installation. | string | latest |

## About Microsoft DSC v3

[Microsoft Desired State Configuration (DSC)](https://github.com/PowerShell/DSC) is a cross-platform, open-source configuration management tool. Unlike PowerShell DSC, DSC v3 is a schema-driven, configuration management platform written in Rust and is not dependent on PowerShell (though it can be used with PowerShell).

With DSC, you can:

- Manage infrastructure using declarative configuration files (YAML/JSON)
- Define desired states for system configurations
- Apply and maintain consistent configurations across your infrastructure
- Test and validate configurations before deployment
- Use DSC across Windows, macOS, and Linux

## OS Support

This Feature should work on recent versions of Debian/Ubuntu-based and RHEL-based distributions with the appropriate package manager installed.

`bash` and `curl` are required to execute the `install.sh` script.

---

_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/dsc/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
42 changes: 42 additions & 0 deletions src/dsc/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"id": "dsc",
"version": "1.0.0",
"name": "Microsoft Desired State Configuration (DSC)",
"documentationURL": "https://github.com/PowerShell/devcontainer-features/tree/main/src/dsc",
"description": "Installs Microsoft Desired State Configuration (DSC), a cross-platform, open-source configuration management tool. DSC enables you to manage your infrastructure using configuration as code.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"preview",
"3.2.3",
"3.2.2",
"3.2.1",
"3.2.0",
"3.1.1",
"3.1.0",
"3.0.2",
"3.0.1",
"3.0.0",
"none"
],
"default": "latest",
"description": "Select or enter a version of Microsoft DSC to install. Use 'latest' for the latest stable version, 'preview' for the latest preview release, 'none' to skip DSC installation."
}
},
"customizations": {
"vscode": {
"settings": {
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes Microsoft DSC (Desired State Configuration) pre-installed and available on the `PATH` for configuration management and infrastructure as code."
}
]
}
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
Loading