generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92302fa
commit 5d88a25
Showing
11 changed files
with
119 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"mads-hartmann.bash-ide-vscode" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"configureZshAsDefaultShell": true | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "20" | ||
}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/audacioustux/devcontainers/common-utils-extras:1": {}, | ||
"ghcr.io/audacioustux/devcontainers/taskfile:1": {} | ||
}, | ||
"updateContentCommand": "npm install -g @devcontainers/cli" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3" | ||
|
||
tasks: | ||
default: | ||
cmd: task --list-all | ||
silent: true | ||
new: ./scripts/new.sh {{.CLI_ARGS}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eax | ||
|
||
# ensure 3 arguments were passed | ||
if [ $# -ne 3 ]; then | ||
echo "Usage: $0 <feature_id> <feature_name> <feature_description>" | ||
exit 1 | ||
fi | ||
|
||
FEATURE_ID=$1 | ||
FEATURE_NAME=$2 | ||
FEATURE_DESCRIPTION=$3 | ||
|
||
# ensure feature does not already exist | ||
if [ -d src/$FEATURE_ID ]; then | ||
echo "Feature $FEATURE_ID already exists" | ||
exit 1 | ||
fi | ||
# ensure feature id is lowercase | ||
if [ "$FEATURE_ID" != "${FEATURE_ID,,}" ]; then | ||
echo "Feature id must be lowercase" | ||
exit 1 | ||
fi | ||
|
||
# copy feature template | ||
cp -r templates/feature/src src/$FEATURE_ID | ||
cp -r templates/feature/test test/$FEATURE_ID | ||
|
||
# update feature metadata | ||
jq \ | ||
--arg FEATURE_ID "$FEATURE_ID" \ | ||
--arg FEATURE_NAME "$FEATURE_NAME" \ | ||
--arg FEATURE_DESCRIPTION "$FEATURE_DESCRIPTION" \ | ||
'.id = $FEATURE_ID | .name = $FEATURE_NAME | .description = $FEATURE_DESCRIPTION' \ | ||
src/$FEATURE_ID/devcontainer-feature.json | sponge src/$FEATURE_ID/devcontainer-feature.json | ||
|
||
# update feature test metadata | ||
jq \ | ||
--arg FEATURE_ID "$FEATURE_ID" \ | ||
'.available_for_nonroot_user.features += {($FEATURE_ID): {}}' \ | ||
test/$FEATURE_ID/scenarios.json | sponge test/$FEATURE_ID/scenarios.json | ||
|
||
# update github workflow to include feature in matrix | ||
yq e '.jobs.test-scenarios.strategy.matrix.features += strenv(FEATURE_ID)' -i .github/workflows/test.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "", | ||
"id": "", | ||
"version": "1.0.0", | ||
"description": "", | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eax | ||
|
||
ARCH=amd64 | ||
if [ "$(uname -m)" = "aarch64" ]; then ARCH=arm64; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
check "user is vscode" grep vscode <(whoami) | ||
|
||
bins=( | ||
) | ||
|
||
for bin in "${bins[@]}"; do | ||
check "$bin" command -v "$bin" | ||
done | ||
|
||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"available_for_nonroot_user": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"remoteUser": "vscode", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"username": "vscode" | ||
} | ||
} | ||
} | ||
} |