Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gh-release allows additional flags #537

Merged
merged 1 commit into from
Sep 30, 2023
Merged
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
1 change: 1 addition & 0 deletions src/gh-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ Github Release feature will download, extract and add to path a release binary f
| binLocation | Location to download the target binary to. Typically a location which exist under PATH variable | string | /usr/local/bin |
| libName | Name for the lib dir (if exists). Will default to binary name if not given | string | - |
| libLocation | Any lib files (if exists) will be downloaded into this location. The binary will then be soft linked from the lib location to the bin location | string | /usr/local/lib |
| additionalFlags | (Optional) Any additional flags for the 'nanolayer install gh-release' command | string | - |


13 changes: 12 additions & 1 deletion src/gh-release/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "gh-release",
"version": "1.0.22",
"version": "1.0.23",
"name": "Github Release",
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/gh-release",
"description": "Github Release feature will download, extract and add to path a release binary from a given repo",
Expand Down Expand Up @@ -63,6 +63,17 @@
"/usr/local/lib"
],
"type": "string"
},
"additionalFlags": {
"default": "",
"description": "(Optional) Any additional flags for the 'nanolayer install gh-release' command ",
"proposals": [
"--no-filter-assets-by-platform",
"--no-filter-assets-by-architecture",
"--no-filter-assets-by-distro",
"--no-filter-assets-by-misc"
],
"type": "string"
}
},
"installsAfter": []
Expand Down
2 changes: 1 addition & 1 deletion src/gh-release/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ $nanolayer_location \
install gh-release \
"$REPO" \
"$BINARYNAMES" --force \
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd $release_tag_regex
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd $release_tag_regex $ADDITIONALFLAGS

12 changes: 12 additions & 0 deletions test/gh-release/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,17 @@
"assetRegex": "^(?!.*(fxdependent))"
}
}
},
"test_apiops": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"gh-release": {
"version": "latest",
"repo": "Azure/apiops",
"binaryNames": "extractor",
"assetRegex": "^extractor\\.linux-.+\\.exe$",
"additionalFlags": "--no-filter-assets-by-platform"
}
}
}
}
9 changes: 9 additions & 0 deletions test/gh-release/test_apiops.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -i

set -e

source dev-container-features-test-lib

check "type extractor" type extractor

reportResults