-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(
tailscale.com
): Add feature. (#19)
- Loading branch information
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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,17 @@ | ||
{ | ||
"name": "tailscale.com", | ||
"id": "tailscale.com", | ||
"version": "1.0.0", | ||
"description": "Install \"tailscale\" binary", | ||
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/tailscale.com", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"default": "latest", | ||
"proposals": [ | ||
"latest" | ||
], | ||
"description": "Currently unused." | ||
} | ||
} | ||
} |
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,36 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
set -o pipefail | ||
set -o noclobber | ||
set -o nounset | ||
set -o allexport | ||
readonly name="tailscale" | ||
apt_get_update() { | ||
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then | ||
echo "Running apt-get update..." | ||
apt-get update -y | ||
fi | ||
} | ||
apt_get_checkinstall() { | ||
if ! dpkg -s "$@" >/dev/null 2>&1; then | ||
apt_get_update | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@" | ||
fi | ||
} | ||
apt_get_cleanup() { | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* | ||
} | ||
echo_banner() { | ||
local text="$1" | ||
echo -e "\e[1m\e[97m\e[41m$text\e[0m" | ||
} | ||
install() { | ||
apt_get_checkinstall unzip curl ca-certificates | ||
curl -fsSL https://tailscale.com/install.sh | sh | ||
apt_get_cleanup | ||
} | ||
echo_banner "devcontainer.community" | ||
echo "Installing $name..." | ||
install "$@" | ||
echo "(*) Done!" |
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,19 @@ | ||
#!/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. | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
|
||
check "execute command" bash -c "tailscale --version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |