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.
Merge pull request #32 from a-0vi/feat/flyctl
feat: add flyctl
- Loading branch information
Showing
5 changed files
with
68 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,16 @@ | ||
{ | ||
"name": "Fly.io CLI", | ||
"id": "flyctl", | ||
"version": "1.0.0", | ||
"description": "Install [flyctl](https://github.com/superfly/flyctl) - Command line tools for [fly.io services](https://fly.io/)", | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils" | ||
], | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"default": "latest", | ||
"description": "The version of flyctl to install. Valid values are 'latest' or a specific version number, e.g. '0.2.111'" | ||
} | ||
} | ||
} |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eax | ||
|
||
ARCH=amd64 | ||
if [ "$(uname -m)" = "aarch64" ]; then ARCH=arm64; fi | ||
|
||
echo "Installing flyctl..." | ||
|
||
# get the download link of github release from the api | ||
URL=$(curl -s https://api.fly.io/app/flyctl_releases/linux/$ARCH/$VERSION) | ||
|
||
# download and extract the binary | ||
curl -fL $URL | tar -xz | ||
|
||
# make the binary executable and create a symlink | ||
chmod +x flyctl | ||
ln -s flyctl fly | ||
|
||
# move the binary and symlink to /usr/local/bin | ||
mv fly /usr/local/bin/fly | ||
mv flyctl /usr/local/bin/flyctl |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
check "user is vscode" grep vscode <(whoami) | ||
|
||
bins=( | ||
flyctl | ||
) | ||
|
||
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,12 @@ | ||
{ | ||
"available_for_nonroot_user": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"remoteUser": "vscode", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"username": "vscode" | ||
}, | ||
"flyctl": {} | ||
} | ||
} | ||
} |