Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit 62e24d6

Browse files
feat: gh-release allows additional flags (#537)
1 parent 3245700 commit 62e24d6

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

src/gh-release/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ Github Release feature will download, extract and add to path a release binary f
2323
| binLocation | Location to download the target binary to. Typically a location which exist under PATH variable | string | /usr/local/bin |
2424
| libName | Name for the lib dir (if exists). Will default to binary name if not given | string | - |
2525
| 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 |
26+
| additionalFlags | (Optional) Any additional flags for the 'nanolayer install gh-release' command | string | - |
2627

2728

src/gh-release/devcontainer-feature.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "gh-release",
3-
"version": "1.0.22",
3+
"version": "1.0.23",
44
"name": "Github Release",
55
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/gh-release",
66
"description": "Github Release feature will download, extract and add to path a release binary from a given repo",
@@ -63,6 +63,17 @@
6363
"/usr/local/lib"
6464
],
6565
"type": "string"
66+
},
67+
"additionalFlags": {
68+
"default": "",
69+
"description": "(Optional) Any additional flags for the 'nanolayer install gh-release' command ",
70+
"proposals": [
71+
"--no-filter-assets-by-platform",
72+
"--no-filter-assets-by-architecture",
73+
"--no-filter-assets-by-distro",
74+
"--no-filter-assets-by-misc"
75+
],
76+
"type": "string"
6677
}
6778
},
6879
"installsAfter": []

src/gh-release/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ $nanolayer_location \
2020
install gh-release \
2121
"$REPO" \
2222
"$BINARYNAMES" --force \
23-
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd $release_tag_regex
23+
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd $release_tag_regex $ADDITIONALFLAGS
2424

test/gh-release/scenarios.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,17 @@
5050
"assetRegex": "^(?!.*(fxdependent))"
5151
}
5252
}
53+
},
54+
"test_apiops": {
55+
"image": "mcr.microsoft.com/devcontainers/base:debian",
56+
"features": {
57+
"gh-release": {
58+
"version": "latest",
59+
"repo": "Azure/apiops",
60+
"binaryNames": "extractor",
61+
"assetRegex": "^extractor\\.linux-.+\\.exe$",
62+
"additionalFlags": "--no-filter-assets-by-platform"
63+
}
64+
}
5365
}
5466
}

test/gh-release/test_apiops.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash -i
2+
3+
set -e
4+
5+
source dev-container-features-test-lib
6+
7+
check "type extractor" type extractor
8+
9+
reportResults

0 commit comments

Comments
 (0)