From 2a1f3e9dee17868c30a35c5293fb7ab8057175c1 Mon Sep 17 00:00:00 2001 From: Aleksandr Ilin Date: Fri, 22 Nov 2024 19:15:05 -0800 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b27b3fa..696b07e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Install `pre-commit` via PIP Installs Packages: "features": { "ghcr.io/deep-space-cartel/devcontainers-features/pip:1": { "packages": "pre-commit", - "location": "/opt/pip/bin", + "location": "/opt/pip", } } } From 0070b97835eedb508c67b76aff66595d8565ae64 Mon Sep 17 00:00:00 2001 From: Alexander Ilyin Date: Sat, 23 Nov 2024 03:47:42 +0000 Subject: [PATCH 2/3] Updates after renaming GitHub org. --- .devcontainer/devcontainer.json | 390 ++++++++++++------------- .env | 2 +- .github/workflows/release.yaml | 94 +++--- .github/workflows/test.yaml | 120 ++++---- .github/workflows/validate.yml | 32 +- .gitignore | 4 +- .pre-commit-config.yaml | 54 ++-- LICENSE | 42 +-- README.md | 354 +++++++++++----------- op.ps1 | 22 +- src/apt/README.md | 48 +-- src/apt/devcontainer-feature.json | 40 +-- src/apt/install.sh | 54 ++-- src/pip/README.md | 50 ++-- src/pip/devcontainer-feature.json | 68 ++--- src/pip/install.sh | 48 +-- src/starship/README.md | 56 ++-- src/starship/devcontainer-feature.json | 78 ++--- src/starship/install.sh | 64 ++-- test/_global/global.sh | 62 ++-- test/_global/scenarios.json | 40 +-- test/apt/scenarios.json | 52 ++-- test/apt/shellcheck.sh | 36 +-- test/apt/shellcheck_and_shfmt.sh | 38 +-- test/apt/shfmt.sh | 36 +-- test/apt/test.sh | 36 +-- test/pip/pre-commit.sh | 36 +-- test/pip/scenarios.json | 28 +- test/pip/test.sh | 40 +-- test/starship/latest.sh | 36 +-- test/starship/pinning.sh | 36 +-- test/starship/scenarios.json | 38 +-- test/starship/test.sh | 36 +-- 33 files changed, 1085 insertions(+), 1085 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a15b335..4d39530 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,195 +1,195 @@ -{ - "customizations": { - "vscode": { - "extensions": [ - "mads-hartmann.bash-ide-vscode", - "yzhang.markdown-all-in-one", - "DavidAnson.vscode-markdownlint", - "streetsidesoftware.code-spell-checker", - "GitHub.vscode-pull-request-github", - "GitHub.vscode-github-actions", - "GitHub.vscode-codeql", - "Codeium.codeium" - ], - "settings": { - "remote.extensionKind": { - "GitHub.vscode-codeql": [ - "ui" - ] - }, - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "label": "Dev Container Feature: Publish Packages", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "publish", - "--namespace", - "deep-space-cartel/devcontainers-features", - "src/" - ], - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Generate Docs", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "generate-docs", - "--namespace", - "deep-space-cartel/devcontainers-features", - "--project-folder", - "src/" - ], - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "pre-commit: manual", - "type": "shell", - "command": "pre-commit", - "args": [ - "run", - "--hook-stage", - "manual" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test Everything", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test" - ], - "group": { - "kind": "test", - "isDefault": true - } - }, - { - "label": "Dev Container Feature: Test Global Scenarios", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--global-scenarios-only", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test starship", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "starship", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test apt", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "apt", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test pip", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "pip", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - } - ] - }, - "dotfiles.repository": "deep-space-cartel/dotfiles", - "editor.fontFamily": "'Hack Nerd Font Mono'", - "files.insertFinalNewline": true, - "json.schemas": [ - { - "fileMatch": [ - "*/devcontainer-feature.json" - ], - "url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json" - } - ], - "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'" - } - } - }, - "features": { - "ghcr.io/deep-space-cartel/devcontainers-features/starship:1": {}, - "ghcr.io/deep-space-cartel/devcontainers-features/pip:1": { - "packages": "pre-commit", - "location": "/opt/pip" - }, - "ghcr.io/deep-space-cartel/devcontainers-features/apt:1": { - "packages": "shellcheck shfmt mc python3-pip python3-venv" - }, - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - }, - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "remoteEnv": { - "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}", - "DOCKER_BUILDKIT": "1", - "BUILDKIT_DEBUG": "1", - "PATH": "${containerEnv:PATH}:/opt/pip/bin" - }, - "remoteUser": "node", - "updateContentCommand": "npm install -g @devcontainers/cli" -} +{ + "customizations": { + "vscode": { + "extensions": [ + "mads-hartmann.bash-ide-vscode", + "yzhang.markdown-all-in-one", + "DavidAnson.vscode-markdownlint", + "streetsidesoftware.code-spell-checker", + "GitHub.vscode-pull-request-github", + "GitHub.vscode-github-actions", + "GitHub.vscode-codeql", + "Codeium.codeium" + ], + "settings": { + "remote.extensionKind": { + "GitHub.vscode-codeql": [ + "ui" + ] + }, + "tasks": { + "version": "2.0.0", + "tasks": [ + { + "label": "Dev Container Feature: Publish Packages", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "publish", + "--namespace", + "deepspacecartel/devcontainers-features", + "src/" + ], + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Generate Docs", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "generate-docs", + "--namespace", + "deepspacecartel/devcontainers-features", + "--project-folder", + "src/" + ], + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "pre-commit: manual", + "type": "shell", + "command": "pre-commit", + "args": [ + "run", + "--hook-stage", + "manual" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test Everything", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test" + ], + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "Dev Container Feature: Test Global Scenarios", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--global-scenarios-only", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test starship", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "starship", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test apt", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "apt", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test pip", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "pip", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + } + ] + }, + "dotfiles.repository": "deepspacecartel/dotfiles", + "editor.fontFamily": "'Hack Nerd Font Mono'", + "files.insertFinalNewline": true, + "json.schemas": [ + { + "fileMatch": [ + "*/devcontainer-feature.json" + ], + "url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json" + } + ], + "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'" + } + } + }, + "features": { + // "ghcr.io/deepspacecartel/devcontainers-features/starship:1": {}, + // "ghcr.io/deepspacecartel/devcontainers-features/pip:1": { + // "packages": "pre-commit", + // "location": "/opt/pip" + // }, + // "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + // "packages": "shellcheck shfmt mc python3-pip python3-venv" + // }, + // "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "remoteEnv": { + "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}", + "DOCKER_BUILDKIT": "1", + "BUILDKIT_DEBUG": "1", + "PATH": "${containerEnv:PATH}:/opt/pip/bin" + }, + "remoteUser": "node", + "updateContentCommand": "npm install -g @devcontainers/cli" +} diff --git a/.env b/.env index 1792869..a2d2fdc 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -GITHUB_TOKEN = "op://DeepSpaceCartel/GITHUB_TOKEN/CLASSIC" +GITHUB_TOKEN = "op://DeepSpaceCartel/GITHUB_TOKEN/CLASSIC" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d0ed9ca..d0b0b96 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,47 +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@v4 - - - 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 +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@v4 + + - 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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 78ad5de..b887a30 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,60 +1,60 @@ -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: - - starship - - pip - - apt - baseImage: - - debian:latest - - ubuntu:latest - - mcr.microsoft.com/devcontainers/base:ubuntu - steps: - - uses: actions/checkout@v4 - - - 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: - - starship - - pip - - apt - steps: - - uses: actions/checkout@v4 - - - 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@v4 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli - - - name: "Testing global scenarios" - run: devcontainer features test --global-scenarios-only . +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: + - starship + - pip + - apt + baseImage: + - debian:latest + - ubuntu:latest + - mcr.microsoft.com/devcontainers/base:ubuntu + steps: + - uses: actions/checkout@v4 + + - 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: + - starship + - pip + - apt + steps: + - uses: actions/checkout@v4 + + - 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@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Testing global scenarios" + run: devcontainer features test --global-scenarios-only . diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 863418e..da2fc60 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,16 +1,16 @@ -name: "Validate devcontainer-feature.json files" -on: - workflow_dispatch: - pull_request: - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: "Validate devcontainer-feature.json files" - uses: devcontainers/action@v1 - with: - validate-only: "true" - base-path-to-features: "./src" +name: "Validate devcontainer-feature.json files" +on: + workflow_dispatch: + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: "Validate devcontainer-feature.json files" + uses: devcontainers/action@v1 + with: + validate-only: "true" + base-path-to-features: "./src" diff --git a/.gitignore b/.gitignore index 64ac88f..d5ec555 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.venv/ -output/ +.venv/ +output/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33e7580..396c159 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,27 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files - - id: mixed-line-ending - args: ['--fix=lf'] -- repo: local - hooks: - - id: devcontainer-docs - name: "Dev Container Features: Generate Docs" - entry: devcontainer features generate-docs --namespace deep-space-cartel/devcontainers-features --project-folder src/ - language: system - always_run: true - pass_filenames: false - - id: devcontainer-test - name: "Dev Container Features: Run Tests" - entry: devcontainer features test - language: system - always_run: true - pass_filenames: false - stages: [manual] +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: mixed-line-ending + args: ['--fix=lf'] +- repo: local + hooks: + - id: devcontainer-docs + name: "Dev Container Features: Generate Docs" + entry: devcontainer features generate-docs --namespace deepspacecartel/devcontainers-features --project-folder src/ + language: system + always_run: true + pass_filenames: false + - id: devcontainer-test + name: "Dev Container Features: Run Tests" + entry: devcontainer features test + language: system + always_run: true + pass_filenames: false + stages: [manual] diff --git a/LICENSE b/LICENSE index 35bef52..6775bd7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2022 Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2022 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 696b07e..0df7871 100644 --- a/README.md +++ b/README.md @@ -1,177 +1,177 @@ -# Dev Container Features - -[![CI - Test Features](https://github.com/deep-space-cartel/devcontainers-features/actions/workflows/test.yaml/badge.svg)](https://github.com/deep-space-cartel/devcontainers-features/actions/workflows/test.yaml) - -## Features - -### `apt` - -```json -{ - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/deep-space-cartel/devcontainers-features/apt:latest": { - "packages": "shellcheck shfmt" - } - } -} -``` - -### `pip` - -Install `pre-commit` via PIP Installs Packages: - -```json -{ - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "remoteEnv": { - "PATH": "${containerEnv:PATH}:/opt/pip/bin" - }, - "features": { - "ghcr.io/deep-space-cartel/devcontainers-features/pip:1": { - "packages": "pre-commit", - "location": "/opt/pip", - } - } -} -``` - -Configure `pre-commit`: - -> `pre-commit` relies on Git and there is permission problem -> which is fixed by `dotfiles.repository`, see example in `starship` section below. - -```bash -pre-commit sample-config > .pre-commit-config.yaml -pre-commit install -pre-commit run --all-files -``` - -### `starship` - -The minimal, blazing-fast, and infinitely customizable prompt for any shell! - -* - -```json -{ - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/deep-space-cartel/devcontainers-features/starship:latest": { - "version": "latest" - } - } -} -``` - -Since `starship` is managed by configuration files in `$HOME` consider using the following repo to automate the process or fork it and adjust to your liking. - -```json -{ - "customizations": { - "vscode": { - "settings": { - "dotfiles.repository": "deep-space-cartel/dotfiles" - } - } - } -} -``` - -If you are using `devcontainers-features/apt` as well then you might have to add `bash-completion` to list of the packages. - -```json -{ - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/deep-space-cartel/devcontainers-features/starship:latest": { - "version": "latest" - } - } -} -``` - -In order to configure fonts install them in your OS: - -* - -Then configure `starship`: - -* - -After that configure VS Code: - -* - -```json -{ - "customizations": { - "vscode": { - "settings": { - "editor.fontFamily": "'Hack Nerd Font Mono'", - "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'" - } - } - } -} -``` - -Example prompt with git details: - -```bash -devcontainers-features on  main +2/-1 [📝✓] -⬢ [Docker] ❯ starship --version -starship 1.20.1 -branch:master -commit_hash:f505324 -build_time:2024-07-27 09:09:51 +00:00 -build_env:rustc 1.80.0 (051478957 2024-07-21), -``` - -Example of when you have to force push: - -```bash -devcontainers-features on  main +/- [++(2)✓] -⬢ [Docker] ❯ git commit --amend -... -devcontainers-features on  main +/- [😵] took 10s -⬢ [Docker] ❯ git status -On branch main -Your branch and 'origin/main' have diverged, -and have 1 and 1 different commits each, respectively. - (use "git pull" if you want to integrate the remote branch with yours) - -nothing to commit, working tree clean - -devcontainers-features on  main +/- [😵] -``` - -Consider using along with: - -* - -## Development - -Run local checks: - -```bash -pre-commit run --hook-stage manual -``` - -Upload packages - -```bash -devcontainer features publish --namespace deep-space-cartel/devcontainers-features src/ -``` - -Generate docs: - -```bash -devcontainer features generate-docs --namespace deep-space-cartel/devcontainers-features --project-folder src/ -``` - -## TODO - -* [ ] [Update collection-index.yml #453](https://github.com/devcontainers/devcontainers.github.io/pull/453). -* [ ] Integrate `starship completions $(basename $SHELL)`. -* [ ] Extract `bash-completion` installation into `utils` package. +# Dev Container Features + +[![CI - Test Features](https://github.com/deepspacecartel/devcontainers-features/actions/workflows/test.yaml/badge.svg)](https://github.com/deepspacecartel/devcontainers-features/actions/workflows/test.yaml) + +## Features + +### `apt` + +```json +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/deepspacecartel/devcontainers-features/apt:2": { + "packages": "shellcheck shfmt" + } + } +} +``` + +### `pip` + +Install `pre-commit` via PIP Installs Packages: + +```json +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/opt/pip/bin" + }, + "features": { + "ghcr.io/deepspacecartel/devcontainers-features/pip:2": { + "packages": "pre-commit", + "location": "/opt/pip", + } + } +} +``` + +Configure `pre-commit`: + +> `pre-commit` relies on Git and there is permission problem +> which is fixed by `dotfiles.repository`, see example in `starship` section below. + +```bash +pre-commit sample-config > .pre-commit-config.yaml +pre-commit install +pre-commit run --all-files +``` + +### `starship` + +The minimal, blazing-fast, and infinitely customizable prompt for any shell! + +* + +```json +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/deepspacecartel/devcontainers-features/starship:2": { + "version": "latest" + } + } +} +``` + +Since `starship` is managed by configuration files in `$HOME` consider using the following repo to automate the process or fork it and adjust to your liking. + +```json +{ + "customizations": { + "vscode": { + "settings": { + "dotfiles.repository": "deepspacecartel/dotfiles" + } + } + } +} +``` + +If you are using `devcontainers-features/apt` as well then you might have to add `bash-completion` to list of the packages. + +```json +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/deepspacecartel/devcontainers-features/starship:2": { + "version": "latest" + } + } +} +``` + +In order to configure fonts install them in your OS: + +* + +Then configure `starship`: + +* + +After that configure VS Code: + +* + +```json +{ + "customizations": { + "vscode": { + "settings": { + "editor.fontFamily": "'Hack Nerd Font Mono'", + "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'" + } + } + } +} +``` + +Example prompt with git details: + +```bash +devcontainers-features on  main +2/-1 [📝✓] +⬢ [Docker] ❯ starship --version +starship 1.20.1 +branch:master +commit_hash:f505324 +build_time:2024-07-27 09:09:51 +00:00 +build_env:rustc 1.80.0 (051478957 2024-07-21), +``` + +Example of when you have to force push: + +```bash +devcontainers-features on  main +/- [++(2)✓] +⬢ [Docker] ❯ git commit --amend +... +devcontainers-features on  main +/- [😵] took 10s +⬢ [Docker] ❯ git status +On branch main +Your branch and 'origin/main' have diverged, +and have 1 and 1 different commits each, respectively. + (use "git pull" if you want to integrate the remote branch with yours) + +nothing to commit, working tree clean + +devcontainers-features on  main +/- [😵] +``` + +Consider using along with: + +* + +## Development + +Run local checks: + +```bash +pre-commit run --hook-stage manual +``` + +Upload packages + +```bash +devcontainer features publish --namespace deepspacecartel/devcontainers-features src/ +``` + +Generate docs: + +```bash +devcontainer features generate-docs --namespace deepspacecartel/devcontainers-features --project-folder src/ +``` + +## TODO + +* [ ] [Update collection-index.yml #453](https://github.com/devcontainers/devcontainers.github.io/pull/453). +* [ ] Integrate `starship completions $(basename $SHELL)`. +* [ ] Extract `bash-completion` installation into `utils` package. diff --git a/op.ps1 b/op.ps1 index e40a329..6f8df2e 100644 --- a/op.ps1 +++ b/op.ps1 @@ -1,11 +1,11 @@ -# Usage: Run PowerShell as Administrator and execute this: -# Set-ExecutionPolicy RemoteSigned - -# Define the path to your .env file -$envFilePath = "./.env" - -# Define the command to execute -$command = "op run --env-file='$envFilePath' -- code --new-window ." - -# Execute the command -Invoke-Expression $command +# Usage: Run PowerShell as Administrator and execute this: +# Set-ExecutionPolicy RemoteSigned + +# Define the path to your .env file +$envFilePath = "./.env" + +# Define the command to execute +$command = "op run --env-file='$envFilePath' -- code --new-window ." + +# Execute the command +Invoke-Expression $command diff --git a/src/apt/README.md b/src/apt/README.md index 0694ce2..d71c339 100644 --- a/src/apt/README.md +++ b/src/apt/README.md @@ -1,24 +1,24 @@ - -# Install package(s) via Advanced Package Tool (apt) - -Install apt packages via JSON or apt.txt - -## Example Usage - -```json -"features": { - "ghcr.io/deep-space-cartel/devcontainers-features/apt:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| -| packages | Install additional packages via apt | string | - | - - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ + +# Install package(s) via Advanced Package Tool (apt) + +Install apt packages via JSON or apt.txt + +## Example Usage + +```json +"features": { + "ghcr.io/deepspacecartel/devcontainers-features/apt:1": {} +} +``` + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| packages | Install additional packages via apt | string | - | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/apt/devcontainer-feature.json b/src/apt/devcontainer-feature.json index 89b77a9..8a9015a 100644 --- a/src/apt/devcontainer-feature.json +++ b/src/apt/devcontainer-feature.json @@ -1,20 +1,20 @@ -{ - "name": "Install package(s) via Advanced Package Tool", - "id": "apt", - "version": "1.1.0", - "description": "Install apt packages via JSON or apt.txt", - "options": { - "packages": { - "type": "string", - "proposals": [ - "shellcheck", - "shfmt" - ], - "default": "", - "description": "Install additional packages via apt" - } - }, - "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils" - ] -} +{ + "name": "Install package(s) via Advanced Package Tool", + "id": "apt", + "version": "2.0.0", + "description": "Install apt packages via JSON or apt.txt", + "options": { + "packages": { + "type": "string", + "proposals": [ + "shellcheck", + "shfmt" + ], + "default": "", + "description": "Install additional packages via apt" + } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/common-utils" + ] +} diff --git a/src/apt/install.sh b/src/apt/install.sh index e34aa02..dd94f1b 100644 --- a/src/apt/install.sh +++ b/src/apt/install.sh @@ -1,27 +1,27 @@ -#!/bin/bash -set -e - -echo "Installing packages: ${PACKAGES}" - -# The 'install.sh' entrypoint script is always executed as the root user. -# -# These following environment variables are passed in by the dev container CLI. -# These may be useful in instances where the context of the final -# remoteUser or containerUser is useful. -# For more details, see https://containers.dev/implementors/features#user-env-var -echo "The effective dev container remoteUser is '$_REMOTE_USER'" -echo "The effective dev container remoteUser's home directory is '$_REMOTE_USER_HOME'" - -echo "The effective dev container containerUser is '$_CONTAINER_USER'" -echo "The effective dev container containerUser's home directory is '$_CONTAINER_USER_HOME'" - -if [ -z "$PACKAGES" ]; then - echo "No APT packages to install" -else - if [ "${_CONTAINER_USER}" = "root" ]; then - apt update && apt install -y ${PACKAGES} && apt autoremove -y && apt clean - else - sudo apt update && sudo apt install -y ${PACKAGES} && sudo apt autoremove -y && sudo apt clean - fi - # sudo rm -rf /tmp/* # It's on Read-Only filesystem -fi +#!/bin/bash +set -e + +echo "Installing packages: ${PACKAGES}" + +# The 'install.sh' entrypoint script is always executed as the root user. +# +# These following environment variables are passed in by the dev container CLI. +# These may be useful in instances where the context of the final +# remoteUser or containerUser is useful. +# For more details, see https://containers.dev/implementors/features#user-env-var +echo "The effective dev container remoteUser is '$_REMOTE_USER'" +echo "The effective dev container remoteUser's home directory is '$_REMOTE_USER_HOME'" + +echo "The effective dev container containerUser is '$_CONTAINER_USER'" +echo "The effective dev container containerUser's home directory is '$_CONTAINER_USER_HOME'" + +if [ -z "$PACKAGES" ]; then + echo "No APT packages to install" +else + if [ "${_CONTAINER_USER}" = "root" ]; then + apt update && apt install -y ${PACKAGES} && apt autoremove -y && apt clean + else + sudo apt update && sudo apt install -y ${PACKAGES} && sudo apt autoremove -y && sudo apt clean + fi + # sudo rm -rf /tmp/* # It's on Read-Only filesystem +fi diff --git a/src/pip/README.md b/src/pip/README.md index 8e2ec92..e654628 100644 --- a/src/pip/README.md +++ b/src/pip/README.md @@ -1,25 +1,25 @@ - -# Install package(s) via Pip Installs Packages (pip) - -Install Python packages via JSON or requirements.txt - -## Example Usage - -```json -"features": { - "ghcr.io/deep-space-cartel/devcontainers-features/pip:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| -| location | - | string | /var/tmp/.venv | -| packages | Install additional packages via apt | string | - | - - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ + +# Install package(s) via Pip Installs Packages (pip) + +Install Python packages via JSON or requirements.txt + +## Example Usage + +```json +"features": { + "ghcr.io/deepspacecartel/devcontainers-features/pip:1": {} +} +``` + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| location | - | string | /var/tmp/.venv | +| packages | Install additional packages via apt | string | - | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/pip/devcontainer-feature.json b/src/pip/devcontainer-feature.json index b35c90f..5daa9ea 100644 --- a/src/pip/devcontainer-feature.json +++ b/src/pip/devcontainer-feature.json @@ -1,34 +1,34 @@ -{ - "name": "Install package(s) via Pip Installs Packages", - "id": "pip", - "version": "1.0.0", - "description": "Install Python packages via JSON or requirements.txt", - "options": { - "location": { - "type": "string", - "proposals": [ - "/opt/pip", - "/tmp/pip", - "/var/tmp/.venv" - ], - "default": "/var/tmp/.venv" - }, - "packages": { - "type": "string", - "proposals": [ - "pre-commit" - ], - "default": "", - "description": "Install additional packages via apt" - } - }, - "dependsOn": { - "ghcr.io/deep-space-cartel/devcontainers-features/apt:1": { - "packages": "python3-pip python3-venv" - } - }, - "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils", - "ghcr.io/deep-space-cartel/devcontainers-features/apt" - ] -} +{ + "name": "Install package(s) via Pip Installs Packages", + "id": "pip", + "version": "2.0.0", + "description": "Install Python packages via JSON or requirements.txt", + "options": { + "location": { + "type": "string", + "proposals": [ + "/opt/pip", + "/tmp/pip", + "/var/tmp/.venv" + ], + "default": "/var/tmp/.venv" + }, + "packages": { + "type": "string", + "proposals": [ + "pre-commit" + ], + "default": "", + "description": "Install additional packages via apt" + } + }, + "dependsOn": { + "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + "packages": "python3-pip python3-venv" + } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/deepspacecartel/devcontainers-features/apt" + ] +} diff --git a/src/pip/install.sh b/src/pip/install.sh index 1e55f1f..dd2690c 100644 --- a/src/pip/install.sh +++ b/src/pip/install.sh @@ -1,24 +1,24 @@ -#!/bin/bash -set -e -set -x - -# The 'install.sh' entrypoint script is always executed as the root user. -# -# These following environment variables are passed in by the dev container CLI. -# These may be useful in instances where the context of the final -# remoteUser or containerUser is useful. -# For more details, see https://containers.dev/implementors/features#user-env-var -echo "The effective dev container remoteUser is '$_REMOTE_USER'" -echo "The effective dev container remoteUser's home directory is '$_REMOTE_USER_HOME'" - -echo "The effective dev container containerUser is '$_CONTAINER_USER'" -echo "The effective dev container containerUser's home directory is '$_CONTAINER_USER_HOME'" - -if [ -z "${PACKAGES}" ]; then - mkdir -pv "${LOCATION}" - echo "No PIP packages to install" | tee -a "${LOCATION}/install.log" -else - python3 -m venv "${LOCATION}" - source "${LOCATION}/bin/activate" - pip install ${PACKAGES} -fi +#!/bin/bash +set -e +set -x + +# The 'install.sh' entrypoint script is always executed as the root user. +# +# These following environment variables are passed in by the dev container CLI. +# These may be useful in instances where the context of the final +# remoteUser or containerUser is useful. +# For more details, see https://containers.dev/implementors/features#user-env-var +echo "The effective dev container remoteUser is '$_REMOTE_USER'" +echo "The effective dev container remoteUser's home directory is '$_REMOTE_USER_HOME'" + +echo "The effective dev container containerUser is '$_CONTAINER_USER'" +echo "The effective dev container containerUser's home directory is '$_CONTAINER_USER_HOME'" + +if [ -z "${PACKAGES}" ]; then + mkdir -pv "${LOCATION}" + echo "No PIP packages to install" | tee -a "${LOCATION}/install.log" +else + python3 -m venv "${LOCATION}" + source "${LOCATION}/bin/activate" + pip install ${PACKAGES} +fi diff --git a/src/starship/README.md b/src/starship/README.md index 2f0f419..e3167ae 100644 --- a/src/starship/README.md +++ b/src/starship/README.md @@ -1,28 +1,28 @@ - -# Starship (starship) - -The minimal, blazing-fast, and infinitely customizable prompt for any shell! - -## Example Usage - -```json -"features": { - "ghcr.io/deep-space-cartel/devcontainers-features/starship:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| -| platform | The platform to install the binary for | string | - | -| bin-dir | The directory to install the binary to | string | - | -| arch | The architecture to install the binary for | string | - | -| base-url | The base URL to download the binary from | string | - | -| version | The version of the binary to install | string | - | - - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ + +# Starship (starship) + +The minimal, blazing-fast, and infinitely customizable prompt for any shell! + +## Example Usage + +```json +"features": { + "ghcr.io/deepspacecartel/devcontainers-features/starship:1": {} +} +``` + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| platform | The platform to install the binary for | string | - | +| bin-dir | The directory to install the binary to | string | - | +| arch | The architecture to install the binary for | string | - | +| base-url | The base URL to download the binary from | string | - | +| version | The version of the binary to install | string | - | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index a3b7e5d..6073792 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -1,39 +1,39 @@ -{ - "name": "Starship", - "id": "starship", - "version": "1.2.0", - "description": "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", - "options": { - "platform": { - "type": "string", - "default": "", - "description": "The platform to install the binary for" - }, - "bin-dir": { - "type": "string", - "default": "", - "description": "The directory to install the binary to" - }, - "arch": { - "type": "string", - "default": "", - "description": "The architecture to install the binary for" - }, - "base-url": { - "type": "string", - "default": "", - "description": "The base URL to download the binary from" - }, - "version": { - "type": "string", - "default": "", - "description": "The version of the binary to install" - } - }, - "dependsOn": { - "ghcr.io/devcontainers/features/common-utils": {}, - "ghcr.io/deep-space-cartel/devcontainers-features/apt:1": { - "packages": "bash-completion" - } - } -} +{ + "name": "Starship", + "id": "starship", + "version": "2.0.0", + "description": "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", + "options": { + "platform": { + "type": "string", + "default": "", + "description": "The platform to install the binary for" + }, + "bin-dir": { + "type": "string", + "default": "", + "description": "The directory to install the binary to" + }, + "arch": { + "type": "string", + "default": "", + "description": "The architecture to install the binary for" + }, + "base-url": { + "type": "string", + "default": "", + "description": "The base URL to download the binary from" + }, + "version": { + "type": "string", + "default": "", + "description": "The version of the binary to install" + } + }, + "dependsOn": { + "ghcr.io/devcontainers/features/common-utils": {}, + "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + "packages": "bash-completion" + } + } +} diff --git a/src/starship/install.sh b/src/starship/install.sh index d80523a..af7747a 100644 --- a/src/starship/install.sh +++ b/src/starship/install.sh @@ -1,32 +1,32 @@ -#!/usr/bin/env bash - -# Enable strict mode -set -euxo pipefail - -# Define install parameters as an array -# Add default parameters -params=("--verbose" "--yes") - -# Add parameters conditionally -if [ -n "$PLATFORM" ]; then - params+=("--platform=$PLATFORM") -fi - -if [ -n "$BIN_DIR" ]; then - params+=("--bin-dir=$BIN_DIR") -fi - -if [ -n "$ARCH" ]; then - params+=("--arch=$ARCH") -fi - -if [ -n "$BASE_URL" ]; then - params+=("--base-url=$BASE_URL") -fi - -if [ -n "$VERSION" ]; then - params+=("--version=$VERSION") -fi - -# Install starship -curl -sS https://starship.rs/install.sh | sh -s -- "${params[@]}" +#!/usr/bin/env bash + +# Enable strict mode +set -euxo pipefail + +# Define install parameters as an array +# Add default parameters +params=("--verbose" "--yes") + +# Add parameters conditionally +if [ -n "$PLATFORM" ]; then + params+=("--platform=$PLATFORM") +fi + +if [ -n "$BIN_DIR" ]; then + params+=("--bin-dir=$BIN_DIR") +fi + +if [ -n "$ARCH" ]; then + params+=("--arch=$ARCH") +fi + +if [ -n "$BASE_URL" ]; then + params+=("--base-url=$BASE_URL") +fi + +if [ -n "$VERSION" ]; then + params+=("--version=$VERSION") +fi + +# Install starship +curl -sS https://starship.rs/install.sh | sh -s -- "${params[@]}" diff --git a/test/_global/global.sh b/test/_global/global.sh index 6f63b68..ca62f47 100644 --- a/test/_global/global.sh +++ b/test/_global/global.sh @@ -1,31 +1,31 @@ -#!/bin/bash - -# The 'test/_global' folder is a special test folder that is not tied to a single feature. -# -# This test file is executed against a running container constructed -# from the value of 'color_and_hello' in the tests/_global/scenarios.json file. -# -# The value of a scenarios element is any properties available in the 'devcontainer.json'. -# Scenarios are useful for testing specific options in a feature, or to test a combination of features. -# -# This test can be run with the following command (from the root of this repo) -# devcontainer features test --global-scenarios-only . - -set -e - -# Optional: Import test library bundled with the devcontainer CLI -source dev-container-features-test-lib - -echo -e "The result of the 'starship --version' command will be:\n" -starship --version -echo -e "\n" - -# Feature-specific tests -# The 'check' command comes from the dev-container-features-test-lib. -check "latest version of starship is from master" bash -c "starship --version | grep 'branch:master'" -check "pre-commit installed" bash -c "command -v pre-commit" - - -# Report result -# If any of the checks above exited with a non-zero exit code, the test will fail. -reportResults +#!/bin/bash + +# The 'test/_global' folder is a special test folder that is not tied to a single feature. +# +# This test file is executed against a running container constructed +# from the value of 'color_and_hello' in the tests/_global/scenarios.json file. +# +# The value of a scenarios element is any properties available in the 'devcontainer.json'. +# Scenarios are useful for testing specific options in a feature, or to test a combination of features. +# +# This test can be run with the following command (from the root of this repo) +# devcontainer features test --global-scenarios-only . + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +echo -e "The result of the 'starship --version' command will be:\n" +starship --version +echo -e "\n" + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. +check "latest version of starship is from master" bash -c "starship --version | grep 'branch:master'" +check "pre-commit installed" bash -c "command -v pre-commit" + + +# Report result +# If any of the checks above exited with a non-zero exit code, the test will fail. +reportResults diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json index 7f28337..0199a3a 100644 --- a/test/_global/scenarios.json +++ b/test/_global/scenarios.json @@ -1,20 +1,20 @@ -{ - "global": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "remoteEnv": { - "PATH": "${containerEnv:PATH}:/opt/pip/bin" - }, - "features": { - "starship": { - "version": "latest" - }, - "apt": { - "packages": "python3-pip python3-venv" - }, - "pip": { - "packages": "pre-commit", - "location": "/opt/pip" - } - } - } -} +{ + "global": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/opt/pip/bin" + }, + "features": { + "starship": { + "version": "latest" + }, + "apt": { + "packages": "python3-pip python3-venv" + }, + "pip": { + "packages": "pre-commit", + "location": "/opt/pip" + } + } + } +} diff --git a/test/apt/scenarios.json b/test/apt/scenarios.json index 05b29fb..0002735 100644 --- a/test/apt/scenarios.json +++ b/test/apt/scenarios.json @@ -1,26 +1,26 @@ -{ - "shellcheck": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "apt": { - "packages": "shellcheck" - } - } - }, - "shfmt": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "apt": { - "packages": "shfmt" - } - } - }, - "shellcheck_and_shfmt": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "apt": { - "packages": "shellcheck shfmt" - } - } - } -} +{ + "shellcheck": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "apt": { + "packages": "shellcheck" + } + } + }, + "shfmt": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "apt": { + "packages": "shfmt" + } + } + }, + "shellcheck_and_shfmt": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "apt": { + "packages": "shellcheck shfmt" + } + } + } +} diff --git a/test/apt/shellcheck.sh b/test/apt/shellcheck.sh index a867b9a..4384ae5 100644 --- a/test/apt/shellcheck.sh +++ b/test/apt/shellcheck.sh @@ -1,18 +1,18 @@ -#!/bin/bash - -set -e - -# Optional: Import test library bundled with the devcontainer CLI -# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib -# Provides the 'check' and 'reportResults' commands. -# shellcheck disable=SC1091 -source dev-container-features-test-lib - -# Feature-specific tests -# The 'check' command comes from the dev-container-features-test-lib. Syntax is... -# check