From 0d45d8d22fdd88164024672762f52172b5e843a7 Mon Sep 17 00:00:00 2001 From: Lyon Till <158992+ljtill@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:59:49 +0000 Subject: [PATCH] feat: implement multi-arch support --- .github/workflows/test-pull.yaml | 2 - .github/workflows/test-push.yaml | 2 - src/argocd/devcontainer-feature.json | 4 +- src/argocd/install.sh | 92 ++++++++++++++----- src/atlas/devcontainer-feature.json | 4 +- src/atlas/install.sh | 98 +++++++++++++------- src/bicep/devcontainer-feature.json | 4 +- src/bicep/install.sh | 90 ++++++++++++++----- src/binaryen/README.md | 24 ----- src/binaryen/devcontainer-feature.json | 15 ---- src/binaryen/install.sh | 68 -------------- src/calicoctl/devcontainer-feature.json | 4 +- src/calicoctl/install.sh | 90 ++++++++++++++----- src/cilium/devcontainer-feature.json | 4 +- src/cilium/install.sh | 92 +++++++++++++------ src/clusterctl/devcontainer-feature.json | 4 +- src/clusterctl/install.sh | 90 ++++++++++++++----- src/deno/devcontainer-feature.json | 4 +- src/deno/install.sh | 92 +++++++++++++------ src/flux/devcontainer-feature.json | 4 +- src/flux/install.sh | 92 +++++++++++++------ src/gcloud/devcontainer-feature.json | 7 +- src/gcloud/install.sh | 85 ++++++++++++------ src/helm/devcontainer-feature.json | 4 +- src/helm/install.sh | 94 +++++++++++++------ src/istioctl/devcontainer-feature.json | 4 +- src/istioctl/install.sh | 92 +++++++++++++------ src/kind/devcontainer-feature.json | 4 +- src/kind/install.sh | 90 ++++++++++++++----- src/kubebuilder/devcontainer-feature.json | 4 +- src/kubebuilder/install.sh | 90 ++++++++++++++----- src/kubectl/devcontainer-feature.json | 9 +- src/kubectl/install.sh | 104 ++++++++++++++-------- src/pulumi/devcontainer-feature.json | 2 +- src/pulumi/install.sh | 88 +++++++++++++----- src/spin/devcontainer-feature.json | 4 +- src/spin/install.sh | 92 +++++++++++++------ src/task/devcontainer-feature.json | 2 +- src/task/install.sh | 92 +++++++++++++------ src/wasm-tools/devcontainer-feature.json | 4 +- src/wasm-tools/install.sh | 92 +++++++++++++------ src/wasmtime/devcontainer-feature.json | 4 +- src/wasmtime/install.sh | 94 +++++++++++++------ src/wit-bindgen/devcontainer-feature.json | 4 +- src/wit-bindgen/install.sh | 92 +++++++++++++------ src/wit-deps/devcontainer-feature.json | 2 +- src/wit-deps/install.sh | 90 ++++++++++++++----- src/zig/devcontainer-feature.json | 4 +- src/zig/install.sh | 94 +++++++++++++------ test/_global/scenarios.json | 7 +- test/_global/tools.sh | 5 -- test/argocd/scenarios.json | 6 +- test/argocd/version.sh | 6 +- test/atlas/scenarios.json | 4 +- test/atlas/version.sh | 4 +- test/bicep/scenarios.json | 6 +- test/bicep/version.sh | 6 +- test/binaryen/scenarios.json | 11 --- test/binaryen/test.sh | 24 ----- test/binaryen/version.sh | 27 ------ test/calicoctl/scenarios.json | 6 +- test/calicoctl/version.sh | 6 +- test/cilium/scenarios.json | 6 +- test/cilium/version.sh | 6 +- test/clusterctl/scenarios.json | 6 +- test/clusterctl/version.sh | 6 +- test/deno/scenarios.json | 4 +- test/deno/version.sh | 4 +- test/flux/scenarios.json | 6 +- test/flux/version.sh | 6 +- test/gcloud/scenarios.json | 12 +-- test/gcloud/update.sh | 15 ---- test/gcloud/version.sh | 4 +- test/helm/scenarios.json | 6 +- test/helm/version.sh | 6 +- test/istioctl/scenarios.json | 6 +- test/istioctl/version.sh | 6 +- test/kind/scenarios.json | 6 +- test/kind/version.sh | 6 +- test/kubebuilder/scenarios.json | 6 +- test/kubebuilder/version.sh | 6 +- test/kubectl/scenarios.json | 6 +- test/kubectl/test.sh | 3 - test/kubectl/version.sh | 6 +- test/pulumi/scenarios.json | 6 +- test/pulumi/version.sh | 6 +- test/spin/scenarios.json | 6 +- test/spin/version.sh | 6 +- test/task/scenarios.json | 4 +- test/task/version.sh | 4 +- test/wasm-tools/scenarios.json | 6 +- test/wasm-tools/version.sh | 6 +- test/wasmtime/scenarios.json | 6 +- test/wasmtime/version.sh | 6 +- test/wit-bindgen/scenarios.json | 6 +- test/wit-bindgen/version.sh | 4 +- test/wit-deps/scenarios.json | 4 +- test/wit-deps/version.sh | 4 +- test/zig/scenarios.json | 6 +- test/zig/version.sh | 6 +- 100 files changed, 1622 insertions(+), 946 deletions(-) delete mode 100644 src/binaryen/README.md delete mode 100644 src/binaryen/devcontainer-feature.json delete mode 100644 src/binaryen/install.sh delete mode 100644 test/binaryen/scenarios.json delete mode 100644 test/binaryen/test.sh delete mode 100644 test/binaryen/version.sh delete mode 100644 test/gcloud/update.sh diff --git a/.github/workflows/test-pull.yaml b/.github/workflows/test-pull.yaml index adf0909..8e6ea28 100644 --- a/.github/workflows/test-pull.yaml +++ b/.github/workflows/test-pull.yaml @@ -16,13 +16,11 @@ jobs: argocd: ./**/argocd/** atlas: ./**/atlas/** bicep: ./**/bicep/** - binaryen: ./**/binaryen/** calicoctl: ./**/calicoctl/** cilium: ./**/cilium/** clusterctl: ./**/clusterctl/** deno: ./**/deno/** flux: ./**/flux/** - func: ./**/func/** gcloud: ./**/gcloud/** helm: ./**/helm/** istioctl: ./**/istioctl/** diff --git a/.github/workflows/test-push.yaml b/.github/workflows/test-push.yaml index abbd18a..416ff0e 100644 --- a/.github/workflows/test-push.yaml +++ b/.github/workflows/test-push.yaml @@ -18,13 +18,11 @@ jobs: - argocd - atlas - bicep - - binaryen - calicoctl - cilium - clusterctl - deno - flux - - func - gcloud - helm - istioctl diff --git a/src/argocd/devcontainer-feature.json b/src/argocd/devcontainer-feature.json index af89254..e5f56c0 100644 --- a/src/argocd/devcontainer-feature.json +++ b/src/argocd/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "argocd", - "version": "1.1.3", + "version": "1.2.0", "name": "Argo CD", "description": "Command line tool (argo-cd)", "documentationURL": "https://argo-cd.readthedocs.io", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/argocd/install.sh b/src/argocd/install.sh index dc9b59b..be46e91 100644 --- a/src/argocd/install.sh +++ b/src/argocd/install.sh @@ -1,51 +1,95 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest ArgoCD version from GitHub..." URL="https://api.github.com/repos/argoproj/argo-cd/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/argoproj/argo-cd/releases/download/v"${VERSION}"/argocd-linux-amd64" - if ! curl -sLf -o ./argocd "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ] || [ -z "$ARCH" ]; then + log "ERROR" "Missing version or architecture information!" + exit 1 + fi + + URL="https://github.com/argoproj/argo-cd/releases/download/v${VERSION}/argocd-linux-${ARCH}" + log "INFO" "Downloading ArgoCD binary from $URL" + + if ! curl -sLf --fail -o ./argocd "$URL"; then + log "ERROR" "Failed to download ArgoCD binary!" exit 1 fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./argocd - chown root:root ./argocd - mv ./argocd /usr/local/bin/argocd +install_binary() { + log "INFO" "Installing ArgoCD..." + install -m 0755 ./argocd /usr/local/bin/argocd + log "INFO" "ArgoCD installed successfully to /usr/local/bin/argocd" } -echo "Activating feature 'argocd'" +log "INFO" "Activating feature 'argocd'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/atlas/devcontainer-feature.json b/src/atlas/devcontainer-feature.json index 83cfafd..37e1e9e 100644 --- a/src/atlas/devcontainer-feature.json +++ b/src/atlas/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "atlas", - "version": "1.0.0", + "version": "1.1.0", "name": "Atlas CLI", "description": "Command line tool (atlas)", "documentationURL": "https://www.mongodb.com/docs/atlas/cli/current/", @@ -18,4 +18,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/atlas/install.sh b/src/atlas/install.sh index afab4b0..bef695c 100644 --- a/src/atlas/install.sh +++ b/src/atlas/install.sh @@ -1,63 +1,97 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest MongoDB Atlas CLI version from GitHub..." URL="https://api.github.com/repos/mongodb/mongodb-atlas-cli/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r '.tag_name | sub("atlascli/v"; "")') + + VERSION=$(jq -r '.tag_name | sub("atlascli/v"; "")' < ./response.json) + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { +detect_arch() { + log "INFO" "Detecting system architecture..." ARCH="$(dpkg --print-architecture)" - case ${ARCH} in - amd64) - URL="https://github.com/mongodb/mongodb-atlas-cli/releases/download/atlascli%2Fv"${VERSION}"/mongodb-atlas-cli_"${VERSION}"_linux_x86_64.deb" - ;; - arm64) - URL="https://github.com/mongodb/mongodb-atlas-cli/releases/download/atlascli%2Fv"${VERSION}"/mongodb-atlas-cli_"${VERSION}"_linux_arm64.deb" - ;; - *) echo "(!) Architecture ${architecture} not supported." - exit 1 - ;; + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; esac - if ! curl -sLf -o ./mongodb-atlas-cli.deb "$URL"; then - echo "ERROR: Unable to download file" + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ] || [ -z "$ARCH" ]; then + log "ERROR" "Missing version or architecture information!" + exit 1 + fi + + URL="https://github.com/mongodb/mongodb-atlas-cli/releases/download/atlascli%2Fv${VERSION}/mongodb-atlas-cli_${VERSION}_linux_${ARCH}.deb" + + log "INFO" "Downloading MongoDB Atlas CLI from $URL" + + if ! curl -sLf --fail -o ./mongodb-atlas-cli.deb "$URL"; then + log "ERROR" "Failed to download MongoDB Atlas CLI!" exit 1 fi + + log "INFO" "Download complete!" } -install() { - chown root:root ./mongodb-atlas-cli.deb - apt install ./mongodb-atlas-cli.deb +install_binary() { + log "INFO" "Installing MongoDB Atlas CLI..." + apt install -y ./mongodb-atlas-cli.deb + log "INFO" "MongoDB Atlas CLI installed successfully!" } -echo "Activating feature 'atlas'" +log "INFO" "Activating feature 'atlas'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/bicep/devcontainer-feature.json b/src/bicep/devcontainer-feature.json index 1cf8629..bb532e8 100644 --- a/src/bicep/devcontainer-feature.json +++ b/src/bicep/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "bicep", - "version": "1.0.3", + "version": "1.1.0", "name": "Bicep CLI", "description": "Command line tool (bicep)", "documentationURL": "https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep", @@ -21,4 +21,4 @@ "containerEnv": { "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT": "1" } -} \ No newline at end of file +} diff --git a/src/bicep/install.sh b/src/bicep/install.sh index f9d6939..7efc909 100644 --- a/src/bicep/install.sh +++ b/src/bicep/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Bicep version from GitHub..." URL="https://api.github.com/repos/azure/bicep/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/azure/bicep/releases/download/v"${VERSION}"/bicep-linux-x64" - if ! curl -sLf -o ./bicep "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/azure/bicep/releases/download/v${VERSION}/bicep-linux-${ARCH}" + log "INFO" "Downloading Bicep from $URL" + + if ! curl -sLf --fail -o ./bicep "$URL"; then + log "ERROR" "Failed to download Bicep!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./bicep - chown root:root ./bicep - mv ./bicep /usr/local/bin/bicep +install_binary() { + log "INFO" "Installing Bicep..." + install -m 0755 ./bicep /usr/local/bin/bicep + log "INFO" "Bicep installed successfully to /usr/local/bin/bicep" } -echo "Activating feature 'bicep'" +log "INFO" "Activating feature 'bicep'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/binaryen/README.md b/src/binaryen/README.md deleted file mode 100644 index 5dd5dd1..0000000 --- a/src/binaryen/README.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Binaryen (binaryen) - -Command line tool (binaryen) - -## Example Usage - -```json -"features": { - "ghcr.io/ljtill/features/binaryen:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| -| version | Select version of binaryen | string | latest | - - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/ljtill/features/blob/main/src/binaryen/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/binaryen/devcontainer-feature.json b/src/binaryen/devcontainer-feature.json deleted file mode 100644 index 487bda6..0000000 --- a/src/binaryen/devcontainer-feature.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "binaryen", - "version": "1.0.6", - "name": "Binaryen", - "description": "Command line tool (binaryen)", - "documentationURL": "https://github.com/WebAssembly/binaryen", - "options": { - "version": { - "type": "string", - "description": "Select version of binaryen", - "default": "latest" - } - }, - "customizations": {} -} diff --git a/src/binaryen/install.sh b/src/binaryen/install.sh deleted file mode 100644 index 5d13f07..0000000 --- a/src/binaryen/install.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -set -e - -cd "$(mktemp -d)" - -check() { - if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." - apt update -y - fi - apt -y install --no-install-recommends "$@" - fi -} - -export DEBIAN_FRONTEND=noninteractive - -check curl ca-certificates jq - -version() { - if [ "${VERSION}" = "latest" ]; then - URL="https://api.github.com/repos/WebAssembly/binaryen/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" - exit 1 - fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/version_//') - else - export VERSION=$(echo ${VERSION} | sed 's/version_//') - fi -} - -download() { - URL="https://github.com/WebAssembly/binaryen/releases/download/version_"${VERSION}"/binaryen-version_"${VERSION}"-x86_64-linux.tar.gz" - if ! curl -sLf -o ./binaryen-version_"${VERSION}"-x86_64-linux.tar.gz "$URL"; then - echo "ERROR: Unable to download file" - exit 1 - fi -} - -install() { - tar -zxof ./binaryen-version_"${VERSION}"-x86_64-linux.tar.gz - chown -R root:root ./binaryen-version_"${VERSION}" - mv ./binaryen-version_"${VERSION}" /opt/binaryen -} - -link() { - ln -s /opt/binaryen/bin/wasm2js /usr/local/bin/wasm2js - ln -s /opt/binaryen/bin/wasm-as /usr/local/bin/wasm-as - ln -s /opt/binaryen/bin/wasm-ctor-eval /usr/local/bin/wasm-ctor-eval - ln -s /opt/binaryen/bin/wasm-dis /usr/local/bin/wasm-dis - ln -s /opt/binaryen/bin/wasm-emscripten-finalize /usr/local/bin/wasm-emscripten-finalize - ln -s /opt/binaryen/bin/wasm-fuzz-lattices /usr/local/bin/wasm-fuzz-lattices - ln -s /opt/binaryen/bin/wasm-fuzz-types /usr/local/bin/wasm-fuzz-types - ln -s /opt/binaryen/bin/wasm-merge /usr/local/bin/wasm-merge - ln -s /opt/binaryen/bin/wasm-metadce /usr/local/bin/wasm-metadce - ln -s /opt/binaryen/bin/wasm-opt /usr/local/bin/wasm-opt - ln -s /opt/binaryen/bin/wasm-reduce /usr/local/bin/wasm-reduce - ln -s /opt/binaryen/bin/wasm-shell /usr/local/bin/wasm-shell - ln -s /opt/binaryen/bin/wasm-split /usr/local/bin/wasm-split -} - -echo "Activating feature 'binaryen'" - -version -download -install -link diff --git a/src/calicoctl/devcontainer-feature.json b/src/calicoctl/devcontainer-feature.json index dc9c6c6..e0133ad 100644 --- a/src/calicoctl/devcontainer-feature.json +++ b/src/calicoctl/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "calicoctl", - "version": "1.0.3", + "version": "1.1.0", "name": "Calico", "description": "Command line tool (calicoctl)", "documentationURL": "https://docs.tigera.io/calico", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/calicoctl/install.sh b/src/calicoctl/install.sh index e0a12cf..aea922b 100644 --- a/src/calicoctl/install.sh +++ b/src/calicoctl/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Calicoctl version from GitHub..." URL="https://api.github.com/repos/projectcalico/calico/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/projectcalico/calico/releases/download/v"${VERSION}"/calicoctl-linux-amd64" - if ! curl -sLf -o ./calicoctl "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/projectcalico/calico/releases/download/v${VERSION}/calicoctl-linux-${ARCH}" + log "INFO" "Downloading Calicoctl from $URL" + + if ! curl -sLf --fail -o ./calicoctl "$URL"; then + log "ERROR" "Failed to download Calicoctl!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./calicoctl - chown root:root ./calicoctl - mv ./calicoctl /usr/local/bin/calicoctl +install_binary() { + log "INFO" "Installing Calicoctl..." + install -m 0755 ./calicoctl /usr/local/bin/calicoctl + log "INFO" "Calicoctl installed successfully to /usr/local/bin/calicoctl" } -echo "Activating feature 'calicoctl'" +log "INFO" "Activating feature 'calicoctl'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/cilium/devcontainer-feature.json b/src/cilium/devcontainer-feature.json index 37352ed..a5aa8a6 100644 --- a/src/cilium/devcontainer-feature.json +++ b/src/cilium/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "cilium", - "version": "1.0.3", + "version": "1.1.0", "name": "Cilium", "description": "Command line tool (cilium)", "documentationURL": "https://docs.cilium.io", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/cilium/install.sh b/src/cilium/install.sh index f2b4558..4677275 100644 --- a/src/cilium/install.sh +++ b/src/cilium/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Cilium CLI version from GitHub..." URL="https://api.github.com/repos/cilium/cilium-cli/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/cilium/cilium-cli/releases/download/v"${VERSION}"/cilium-linux-amd64.tar.gz" - if ! curl -sLf -o ./cilium-linux-amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/cilium/cilium-cli/releases/download/v${VERSION}/cilium-linux-${ARCH}.tar.gz" + log "INFO" "Downloading Cilium CLI from $URL" + + if ! curl -sLf --fail -o ./cilium.tar.gz "$URL"; then + log "ERROR" "Failed to download Cilium CLI!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./cilium-linux-amd64.tar.gz - chmod +x ./cilium - chown root:root ./cilium - mv ./cilium /usr/local/bin/cilium +install_binary() { + log "INFO" "Installing Cilium CLI..." + tar -zxof ./cilium.tar.gz + install -m 0755 ./cilium /usr/local/bin/cilium + log "INFO" "Cilium CLI installed successfully to /usr/local/bin/cilium" } -echo "Activating feature 'cilium'" +log "INFO" "Activating feature 'cilium'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/clusterctl/devcontainer-feature.json b/src/clusterctl/devcontainer-feature.json index 2fd8fb5..2fde90a 100644 --- a/src/clusterctl/devcontainer-feature.json +++ b/src/clusterctl/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "clusterctl", - "version": "1.1.3", + "version": "1.2.0", "name": "Cluster API", "description": "Command line tool (clusterctl)", "documentationURL": "https://cluster-api.sigs.k8s.io", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/clusterctl/install.sh b/src/clusterctl/install.sh index 3b62a4d..020b258 100644 --- a/src/clusterctl/install.sh +++ b/src/clusterctl/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest clusterctl version from GitHub..." URL="https://api.github.com/repos/kubernetes-sigs/cluster-api/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/kubernetes-sigs/cluster-api/releases/download/v"${VERSION}"/clusterctl-linux-amd64" - if ! curl -sLf -o ./clusterctl "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/kubernetes-sigs/cluster-api/releases/download/v${VERSION}/clusterctl-linux-${ARCH}" + log "INFO" "Downloading clusterctl from $URL" + + if ! curl -sLf --fail -o ./clusterctl "$URL"; then + log "ERROR" "Failed to download clusterctl!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./clusterctl - chown root:root ./clusterctl - mv ./clusterctl /usr/local/bin/clusterctl +install_binary() { + log "INFO" "Installing clusterctl..." + install -m 0755 ./clusterctl /usr/local/bin/clusterctl + log "INFO" "clusterctl installed successfully to /usr/local/bin/clusterctl" } -echo "Activating feature 'clusterctl'" +log "INFO" "Activating feature 'clusterctl'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/deno/devcontainer-feature.json b/src/deno/devcontainer-feature.json index 5d183ad..628e063 100644 --- a/src/deno/devcontainer-feature.json +++ b/src/deno/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "deno", - "version": "1.0.3", + "version": "1.1.0", "name": "Deno CLI", "description": "Command line tool (deno)", "documentationURL": "https://docs.deno.com", @@ -18,4 +18,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/deno/install.sh b/src/deno/install.sh index 80d5d73..610fe62 100644 --- a/src/deno/install.sh +++ b/src/deno/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq unzip -check curl ca-certificates jq unzip +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Deno version from GitHub..." URL="https://api.github.com/repos/denoland/deno/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/denoland/deno/releases/download/v"${VERSION}"/deno-x86_64-unknown-linux-gnu.zip" - if ! curl -sLf -o ./deno-x86_64-unknown-linux-gnu.zip "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/denoland/deno/releases/download/v${VERSION}/deno-${ARCH}-unknown-linux-gnu.zip" + log "INFO" "Downloading Deno from $URL" + + if ! curl -sLf --fail -o ./deno.zip "$URL"; then + log "ERROR" "Failed to download Deno!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - unzip ./deno-x86_64-unknown-linux-gnu.zip - chmod +x ./deno - chown root:root ./deno - mv ./deno /usr/local/bin/deno +install_binary() { + log "INFO" "Installing Deno..." + unzip -q ./deno.zip + install -m 0755 ./deno /usr/local/bin/deno + log "INFO" "Deno installed successfully to /usr/local/bin/deno" } -echo "Activating feature 'deno'" +log "INFO" "Activating feature 'deno'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/flux/devcontainer-feature.json b/src/flux/devcontainer-feature.json index db26e6d..f81b694 100644 --- a/src/flux/devcontainer-feature.json +++ b/src/flux/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "flux", - "version": "1.1.4", + "version": "1.2.0", "name": "Flux", "description": "Command line tool (flux)", "documentationURL": "https://fluxcd.io/flux", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/flux/install.sh b/src/flux/install.sh index f7015f5..2c19659 100644 --- a/src/flux/install.sh +++ b/src/flux/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Flux CLI version from GitHub..." URL="https://api.github.com/repos/fluxcd/flux2/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/fluxcd/flux2/releases/download/v"${VERSION}"/flux_"${VERSION}"_linux_amd64.tar.gz" - if ! curl -sLf -o ./flux_linux_amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_${ARCH}.tar.gz" + log "INFO" "Downloading Flux CLI from $URL" + + if ! curl -sLf --fail -o ./flux.tar.gz "$URL"; then + log "ERROR" "Failed to download Flux CLI!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./flux_linux_amd64.tar.gz - chmod +x ./flux - chown root:root ./flux - mv ./flux /usr/local/bin/flux +install_binary() { + log "INFO" "Installing Flux CLI..." + tar -zxof ./flux.tar.gz + install -m 0755 ./flux /usr/local/bin/flux + log "INFO" "Flux CLI installed successfully to /usr/local/bin/flux" } -echo "Activating feature 'flux'" +log "INFO" "Activating feature 'flux'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/gcloud/devcontainer-feature.json b/src/gcloud/devcontainer-feature.json index f94973d..40ea241 100644 --- a/src/gcloud/devcontainer-feature.json +++ b/src/gcloud/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "gcloud", - "version": "1.2.0", + "version": "1.3.0", "name": "Google Cloud", "description": "Command line tool (gcloud)", "documentationURL": "https://cloud.google.com", @@ -9,11 +9,6 @@ "type": "string", "description": "Select version of gcloud", "default": "latest" - }, - "update": { - "type": "boolean", - "description": "Update gcloud components", - "default": true } }, "customizations": { diff --git a/src/gcloud/install.sh b/src/gcloud/install.sh index 31801a6..934330f 100644 --- a/src/gcloud/install.sh +++ b/src/gcloud/install.sh @@ -1,53 +1,86 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq python3 -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then - export URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz" + if [ "$VERSION" = "latest" ]; then + log "INFO" "Using latest Google Cloud SDK version..." else - VERSION=$(echo ${VERSION} | sed 's/v//') - export URL="https://storage.googleapis.com/cloud-sdk-release/google-cloud-cli-"${VERSION}"-linux-x86_64.tar.gz" + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION +} + +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="arm" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH } -download() { - if ! curl -sLf -o ./google-cloud-cli-linux-x86_64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +download_binary() { + if [ "$VERSION" = "latest" ]; then + URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-${ARCH}.tar.gz" + else + URL="https://storage.googleapis.com/cloud-sdk-release/google-cloud-cli-${VERSION}-linux-${ARCH}.tar.gz" + fi + + log "INFO" "Downloading Google Cloud SDK from $URL" + + if ! curl -sLf --fail -o ./gcloud.tar.gz "$URL"; then + log "ERROR" "Failed to download Google Cloud SDK!" exit 1 fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./google-cloud-cli-linux-x86_64.tar.gz +install_binary() { + log "INFO" "Installing Google Cloud SDK..." + tar -zxof ./gcloud.tar.gz mv ./google-cloud-sdk /opt/ /opt/google-cloud-sdk/install.sh --rc-path /etc/bash.bashrc --quiet + log "INFO" "Google Cloud SDK installed successfully to /opt/google-cloud-sdk" } -update() { - if [ "${UPDATE}" = "true" ]; then - /opt/google-cloud-sdk/bin/gcloud components update - fi -} +log "INFO" "Activating feature 'gcloud'" -echo "Activating feature 'gcloud'" +get_version +detect_arch +download_binary +install_binary -version -download -install -update +log "INFO" "Installation complete!" diff --git a/src/helm/devcontainer-feature.json b/src/helm/devcontainer-feature.json index a303365..6798164 100644 --- a/src/helm/devcontainer-feature.json +++ b/src/helm/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "helm", - "version": "1.1.3", + "version": "1.2.0", "name": "Helm", "description": "Command line tool (helm)", "documentationURL": "https://helm.sh/docs", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/helm/install.sh b/src/helm/install.sh index e2ee893..1aad97f 100644 --- a/src/helm/install.sh +++ b/src/helm/install.sh @@ -1,53 +1,95 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Helm version from GitHub..." URL="https://api.github.com/repos/helm/helm/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://get.helm.sh/helm-v"${VERSION}"-linux-amd64.tar.gz" - if ! curl -sLf -o ./helm-linux-amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://get.helm.sh/helm-v${VERSION}-linux-${ARCH}.tar.gz" + log "INFO" "Downloading Helm from $URL" + + if ! curl -sLf --fail -o ./helm.tar.gz "$URL"; then + log "ERROR" "Failed to download Helm!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./helm-linux-amd64.tar.gz - chmod +x ./linux-amd64/helm - chown root:root ./linux-amd64/helm - mv ./linux-amd64/helm /usr/local/bin/helm - rm -rf ./linux-amd64 +install_binary() { + log "INFO" "Installing Helm..." + tar -zxof ./helm.tar.gz + install -m 0755 ./linux-${ARCH}/helm /usr/local/bin/helm + rm -rf ./linux-${ARCH} + log "INFO" "Helm installed successfully to /usr/local/bin/helm" } -echo "Activating feature 'helm'" +log "INFO" "Activating feature 'helm'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/istioctl/devcontainer-feature.json b/src/istioctl/devcontainer-feature.json index 1697da6..b777e0e 100644 --- a/src/istioctl/devcontainer-feature.json +++ b/src/istioctl/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "istioctl", - "version": "1.1.4", + "version": "1.2.0", "name": "Istio", "description": "Command line tool (istioctl)", "documentationURL": "https://istio.io/latest/docs", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/istioctl/install.sh b/src/istioctl/install.sh index b0b7479..b4659b1 100644 --- a/src/istioctl/install.sh +++ b/src/istioctl/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Istioctl version from GitHub..." URL="https://api.github.com/repos/istio/istio/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/istio/istio/releases/download/"${VERSION}"/istioctl-"${VERSION}"-linux-amd64.tar.gz" - if ! curl -sLf -o ./istioctl-linux-amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/istio/istio/releases/download/${VERSION}/istioctl-${VERSION}-linux-${ARCH}.tar.gz" + log "INFO" "Downloading Istioctl from $URL" + + if ! curl -sLf --fail -o ./istioctl.tar.gz "$URL"; then + log "ERROR" "Failed to download Istioctl!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./istioctl-linux-amd64.tar.gz - chmod +x ./istioctl - chown root:root ./istioctl - mv ./istioctl /usr/local/bin/istioctl +install_binary() { + log "INFO" "Installing Istioctl..." + tar -zxof ./istioctl.tar.gz + install -m 0755 ./istioctl /usr/local/bin/istioctl + log "INFO" "Istioctl installed successfully to /usr/local/bin/istioctl" } -echo "Activating feature 'istioctl'" +log "INFO" "Activating feature 'istioctl'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/kind/devcontainer-feature.json b/src/kind/devcontainer-feature.json index 24a5d93..220ca99 100644 --- a/src/kind/devcontainer-feature.json +++ b/src/kind/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "kind", - "version": "1.1.3", + "version": "1.2.0", "name": "Kubernetes in Docker CLI", "description": "Command line tool (kind)", "documentationURL": "https://kind.sigs.k8s.io", @@ -19,4 +19,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/kind/install.sh b/src/kind/install.sh index f0263de..123089f 100644 --- a/src/kind/install.sh +++ b/src/kind/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Kind version from GitHub..." URL="https://api.github.com/repos/kubernetes-sigs/kind/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/kubernetes-sigs/kind/releases/download/v"${VERSION}"/kind-linux-amd64" - if ! curl -sLf -o ./kind "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/kubernetes-sigs/kind/releases/download/v${VERSION}/kind-linux-${ARCH}" + log "INFO" "Downloading Kind from $URL" + + if ! curl -sLf --fail -o ./kind "$URL"; then + log "ERROR" "Failed to download Kind!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./kind - chown root:root ./kind - mv ./kind /usr/local/bin/kind +install_binary() { + log "INFO" "Installing Kind..." + install -m 0755 ./kind /usr/local/bin/kind + log "INFO" "Kind installed successfully to /usr/local/bin/kind" } -echo "Activating feature 'kind'" +log "INFO" "Activating feature 'kind'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/kubebuilder/devcontainer-feature.json b/src/kubebuilder/devcontainer-feature.json index 6e6097b..11faa5a 100644 --- a/src/kubebuilder/devcontainer-feature.json +++ b/src/kubebuilder/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "kubebuilder", - "version": "1.1.4", + "version": "1.2.0", "name": "Kubebuilder", "description": "Command line tool (kubebuilder)", "documentationURL": "https://book.kubebuilder.io", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/kubebuilder/install.sh b/src/kubebuilder/install.sh index 545cd3f..87c840a 100644 --- a/src/kubebuilder/install.sh +++ b/src/kubebuilder/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Kubebuilder version from GitHub..." URL="https://api.github.com/repos/kubernetes-sigs/kubebuilder/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v"${VERSION}"/kubebuilder_linux_amd64" - if ! curl -sLf -o ./kubebuilder "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${VERSION}/kubebuilder_linux_${ARCH}" + log "INFO" "Downloading Kubebuilder from $URL" + + if ! curl -sLf --fail -o ./kubebuilder "$URL"; then + log "ERROR" "Failed to download Kubebuilder!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./kubebuilder - chown root:root ./kubebuilder - mv ./kubebuilder /usr/local/bin/kubebuilder +install_binary() { + log "INFO" "Installing Kubebuilder..." + install -m 0755 ./kubebuilder /usr/local/bin/kubebuilder + log "INFO" "Kubebuilder installed successfully to /usr/local/bin/kubebuilder" } -echo "Activating feature 'kubebuilder'" +log "INFO" "Activating feature 'kubebuilder'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/kubectl/devcontainer-feature.json b/src/kubectl/devcontainer-feature.json index 21b66af..ddd5508 100644 --- a/src/kubectl/devcontainer-feature.json +++ b/src/kubectl/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "kubectl", - "version": "1.4.4", + "version": "1.5.0", "name": "Kubernetes CLI", "description": "Command line tool (kubectl)", "documentationURL": "https://kubernetes.io/docs/reference/kubectl", @@ -9,11 +9,6 @@ "type": "string", "description": "Select version of kubectl", "default": "latest" - }, - "kubelogin": { - "type": "boolean", - "description": "Optionally install kubelogin (https://aka.ms/aks/kubelogin)", - "default": true } }, "customizations": { @@ -23,4 +18,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/kubectl/install.sh b/src/kubectl/install.sh index 9a3beeb..3b0c26e 100644 --- a/src/kubectl/install.sh +++ b/src/kubectl/install.sh @@ -1,67 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq git unzip -check curl ca-certificates jq git +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Kubectl version..." URL="https://dl.k8s.io/release/stable.txt" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.txt "$URL"; then + log "ERROR" "Unable to fetch latest version from Kubernetes releases!" exit 1 fi - export VERSION=$(cat ./response.json | sed 's/v//') + + VERSION=$(cat ./response.txt | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION +} + +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH } -download() { - URL="https://dl.k8s.io/release/v"${VERSION}"/bin/linux/amd64/kubectl" - if ! curl -sLf -o ./kubectl "$URL"; then - echo "ERROR: Unable to download file" +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi -} -install() { - chmod +x ./kubectl - chown root:root ./kubectl - mv ./kubectl /usr/local/bin/kubectl -} + URL="https://dl.k8s.io/release/v${VERSION}/bin/linux/${ARCH}/kubectl" + log "INFO" "Downloading Kubectl from $URL" -options() { - if [ "${KUBELOGIN}" = "true" ]; then - URL="https://github.com/Azure/kubelogin/releases/latest/download/kubelogin-linux-amd64.zip" - if ! curl -sLf -o ./kubelogin-linux-amd64.zip "$URL"; then - echo "ERROR: Unable to download file" - exit 1 - fi - - unzip ./kubelogin-linux-amd64.zip - chmod +x ./bin/linux_amd64/kubelogin - chown root:root ./bin/linux_amd64/kubelogin - mv ./bin/linux_amd64/kubelogin /usr/local/bin/kubelogin + if ! curl -sLf --fail -o ./kubectl "$URL"; then + log "ERROR" "Failed to download Kubectl!" + exit 1 fi + + log "INFO" "Download complete!" +} + +install_binary() { + log "INFO" "Installing Kubectl..." + install -m 0755 ./kubectl /usr/local/bin/kubectl + log "INFO" "Kubectl installed successfully to /usr/local/bin/kubectl" } -echo "Activating feature 'kubectl'" +log "INFO" "Activating feature 'kubectl'" + +get_version +detect_arch +download_binary +install_binary -version -download -install -options +log "INFO" "Installation complete!" diff --git a/src/pulumi/devcontainer-feature.json b/src/pulumi/devcontainer-feature.json index 1d3e3ac..deef05f 100644 --- a/src/pulumi/devcontainer-feature.json +++ b/src/pulumi/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "pulumi", - "version": "1.1.5", + "version": "1.2.0", "name": "Pulumi", "description": "Command line tool (pulumi)", "documentationURL": "https://www.pulumi.com/docs", diff --git a/src/pulumi/install.sh b/src/pulumi/install.sh index 51fb39b..3fc494e 100644 --- a/src/pulumi/install.sh +++ b/src/pulumi/install.sh @@ -1,52 +1,96 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Pulumi version from GitHub..." URL="https://api.github.com/repos/pulumi/pulumi/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://get.pulumi.com/releases/sdk/pulumi-v"${VERSION}"-linux-x64.tar.gz" - if ! curl -sLf -o ./pulumi-linux-x64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-${ARCH}.tar.gz" + log "INFO" "Downloading Pulumi from $URL" + + if ! curl -sLf --fail -o ./pulumi.tar.gz "$URL"; then + log "ERROR" "Failed to download Pulumi!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./pulumi-linux-x64.tar.gz +install_binary() { + log "INFO" "Installing Pulumi..." + tar -zxof ./pulumi.tar.gz chmod +x ./pulumi/pulumi chown -R root:root ./pulumi/ mv ./pulumi/* /usr/local/bin/ + log "INFO" "Pulumi installed successfully to /usr/local/bin/" } -echo "Activating feature 'pulumi'" +log "INFO" "Activating feature 'pulumi'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/spin/devcontainer-feature.json b/src/spin/devcontainer-feature.json index d047d65..9481376 100644 --- a/src/spin/devcontainer-feature.json +++ b/src/spin/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "spin", - "version": "1.1.3", + "version": "1.2.0", "name": "Spin", "description": "Command line tool (spin)", "documentationURL": "https://developer.fermyon.com/spin", @@ -21,4 +21,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/spin/install.sh b/src/spin/install.sh index a30b8a9..a4f95f2 100644 --- a/src/spin/install.sh +++ b/src/spin/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Spin version from GitHub..." URL="https://api.github.com/repos/fermyon/spin/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/fermyon/spin/releases/download/v"${VERSION}"/spin-v"${VERSION}"-linux-amd64.tar.gz" - if ! curl -sLf -o ./spin-linux-amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/fermyon/spin/releases/download/v${VERSION}/spin-v${VERSION}-linux-${ARCH}.tar.gz" + log "INFO" "Downloading Spin from $URL" + + if ! curl -sLf --fail -o ./spin-linux-${ARCH}.tar.gz "$URL"; then + log "ERROR" "Failed to download Spin!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./spin-linux-amd64.tar.gz - chmod +x ./spin - chown root:root ./spin - mv ./spin /usr/local/bin/spin +install_binary() { + log "INFO" "Installing Spin..." + tar -zxof ./spin-linux-${ARCH}.tar.gz + install -m 0755 ./spin /usr/local/bin/spin + log "INFO" "Spin installed successfully to /usr/local/bin/spin" } -echo "Activating feature 'spin'" +log "INFO" "Activating feature 'spin'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/task/devcontainer-feature.json b/src/task/devcontainer-feature.json index af02208..07999f8 100644 --- a/src/task/devcontainer-feature.json +++ b/src/task/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "task", - "version": "1.0.1", + "version": "1.1.0", "name": "Task CLI", "description": "Command line tool (task)", "documentationURL": "https://github.com/go-task/task", diff --git a/src/task/install.sh b/src/task/install.sh index 9f63f70..01e38bd 100644 --- a/src/task/install.sh +++ b/src/task/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Go Task version from GitHub..." URL="https://api.github.com/repos/go-task/task/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/go-task/task/releases/download/v"${VERSION}"/task_linux_amd64.tar.gz" - if ! curl -sLf -o ./task_linux_amd64.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/go-task/task/releases/download/v${VERSION}/task_linux_${ARCH}.tar.gz" + log "INFO" "Downloading Go Task from $URL" + + if ! curl -sLf --fail -o ./task_linux_${ARCH}.tar.gz "$URL"; then + log "ERROR" "Failed to download Go Task!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./task_linux_amd64.tar.gz - chmod +x ./task - chown root:root ./task - mv ./task /usr/local/bin/task +install_binary() { + log "INFO" "Installing Go Task..." + tar -zxof ./task_linux_${ARCH}.tar.gz + install -m 0755 ./task /usr/local/bin/task + log "INFO" "Go Task installed successfully to /usr/local/bin/task" } -echo "Activating feature 'task'" +log "INFO" "Activating feature 'task'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/wasm-tools/devcontainer-feature.json b/src/wasm-tools/devcontainer-feature.json index b7f37d1..91e9dab 100644 --- a/src/wasm-tools/devcontainer-feature.json +++ b/src/wasm-tools/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "wasm-tools", - "version": "1.0.3", + "version": "1.1.0", "name": "WASM Tools", "description": "Command line tool (wasm-tools)", "documentationURL": "https://github.com/bytecodealliance/wasm-tools", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/wasm-tools/install.sh b/src/wasm-tools/install.sh index b83ef4b..623e00a 100644 --- a/src/wasm-tools/install.sh +++ b/src/wasm-tools/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Wasm Tools version from GitHub..." URL="https://api.github.com/repos/bytecodealliance/wasm-tools/releases" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r "first | .tag_name" | sed 's/v//') + + VERSION=$(jq -r "first | .tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/bytecodealliance/wasm-tools/releases/download/v"${VERSION}"/wasm-tools-"${VERSION}"-x86_64-linux.tar.gz" - if ! curl -sLf -o ./wasm-tools-"${VERSION}"-x86_64-linux.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/bytecodealliance/wasm-tools/releases/download/v${VERSION}/wasm-tools-${VERSION}-${ARCH}-linux.tar.gz" + log "INFO" "Downloading Wasm Tools from $URL" + + if ! curl -sLf --fail -o ./wasm-tools.tar.gz "$URL"; then + log "ERROR" "Failed to download Wasm Tools!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./wasm-tools-"${VERSION}"-x86_64-linux.tar.gz - chmod +x ./wasm-tools-"${VERSION}"-x86_64-linux/wasm-tools - chown root:root ./wasm-tools-"${VERSION}"-x86_64-linux/wasm-tools - mv ./wasm-tools-"${VERSION}"-x86_64-linux/wasm-tools /usr/local/bin/wasm-tools +install_binary() { + log "INFO" "Installing Wasm Tools..." + tar -zxof ./wasm-tools.tar.gz + install -m 0755 ./wasm-tools-${VERSION}-${ARCH}-linux/wasm-tools /usr/local/bin/wasm-tools + log "INFO" "Wasm Tools installed successfully to /usr/local/bin/wasm-tools" } -echo "Activating feature 'wasm-tools'" +log "INFO" "Activating feature 'wasm-tools'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/wasmtime/devcontainer-feature.json b/src/wasmtime/devcontainer-feature.json index 959e2c4..f1b5c98 100644 --- a/src/wasmtime/devcontainer-feature.json +++ b/src/wasmtime/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "wasmtime", - "version": "1.1.3", + "version": "1.2.0", "name": "Wasmtime CLI", "description": "Command line tool (wasmtime)", "documentationURL": "https://docs.wasmtime.dev", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/wasmtime/install.sh b/src/wasmtime/install.sh index bd8326d..14e2343 100644 --- a/src/wasmtime/install.sh +++ b/src/wasmtime/install.sh @@ -1,53 +1,95 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq xz-utils -check curl ca-certificates jq xz-utils +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Wasmtime version from GitHub..." URL="https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/bytecodealliance/wasmtime/releases/download/v"${VERSION}"/wasmtime-v"${VERSION}"-x86_64-linux.tar.xz" - if ! curl -sLf -o ./wasmtime-v"${VERSION}"-x86_64-linux.tar.xz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/bytecodealliance/wasmtime/releases/download/v${VERSION}/wasmtime-v${VERSION}-${ARCH}-linux.tar.xz" + log "INFO" "Downloading Wasmtime from $URL" + + if ! curl -sLf --fail -o ./wasmtime.tar.xz "$URL"; then + log "ERROR" "Failed to download Wasmtime!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - xz -d ./wasmtime-v"${VERSION}"-x86_64-linux.tar.xz - tar -xof ./wasmtime-v"${VERSION}"-x86_64-linux.tar - chmod +x ./wasmtime-v"${VERSION}"-x86_64-linux/wasmtime - chown root:root ./wasmtime-v"${VERSION}"-x86_64-linux/wasmtime - mv ./wasmtime-v"${VERSION}"-x86_64-linux/wasmtime /usr/local/bin/wasmtime +install_binary() { + log "INFO" "Installing Wasmtime..." + xz -d ./wasmtime.tar.xz + tar -xof ./wasmtime.tar + install -m 0755 ./wasmtime-v${VERSION}-${ARCH}-linux/wasmtime /usr/local/bin/wasmtime + log "INFO" "Wasmtime installed successfully to /usr/local/bin/wasmtime" } -echo "Activating feature 'wasmtime'" +log "INFO" "Activating feature 'wasmtime'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/wit-bindgen/devcontainer-feature.json b/src/wit-bindgen/devcontainer-feature.json index 7ca2ef9..e26a46b 100644 --- a/src/wit-bindgen/devcontainer-feature.json +++ b/src/wit-bindgen/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "wit-bindgen", - "version": "1.0.4", + "version": "1.1.0", "name": "WIT Bindgen CLI", "description": "Command line tool (wit-bindgen)", "documentationURL": "https://github.com/bytecodealliance/wit-bindgen", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/wit-bindgen/install.sh b/src/wit-bindgen/install.sh index f7401cf..93c6b22 100644 --- a/src/wit-bindgen/install.sh +++ b/src/wit-bindgen/install.sh @@ -1,52 +1,94 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest WIT Bindgen version from GitHub..." URL="https://api.github.com/repos/bytecodealliance/wit-bindgen/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/bytecodealliance/wit-bindgen/releases/download/v"${VERSION}"/wit-bindgen-"${VERSION}"-x86_64-linux.tar.gz" - if ! curl -sLf -o ./wit-bindgen-v"${VERSION}"-x86_64-linux.tar.gz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/bytecodealliance/wit-bindgen/releases/download/v${VERSION}/wit-bindgen-${VERSION}-${ARCH}-linux.tar.gz" + log "INFO" "Downloading WIT Bindgen from $URL" + + if ! curl -sLf --fail -o ./wit-bindgen.tar.gz "$URL"; then + log "ERROR" "Failed to download WIT Bindgen!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - tar -zxof ./wit-bindgen-v"${VERSION}"-x86_64-linux.tar.gz - chmod +x ./wit-bindgen-"${VERSION}"-x86_64-linux/wit-bindgen - chown root:root ./wit-bindgen-"${VERSION}"-x86_64-linux/wit-bindgen - mv ./wit-bindgen-"${VERSION}"-x86_64-linux/wit-bindgen /usr/local/bin/wit-bindgen +install_binary() { + log "INFO" "Installing WIT Bindgen..." + tar -zxof ./wit-bindgen.tar.gz + install -m 0755 ./wit-bindgen-${VERSION}-${ARCH}-linux/wit-bindgen /usr/local/bin/wit-bindgen + log "INFO" "WIT Bindgen installed successfully to /usr/local/bin/wit-bindgen" } -echo "Activating feature 'wit-bindgen'" +log "INFO" "Activating feature 'wit-bindgen'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/wit-deps/devcontainer-feature.json b/src/wit-deps/devcontainer-feature.json index 35f883e..881208f 100644 --- a/src/wit-deps/devcontainer-feature.json +++ b/src/wit-deps/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "wit-deps", - "version": "1.1.0", + "version": "1.2.0", "name": "WIT Dependency Manager CLI", "description": "Command line tool (wit-deps)", "documentationURL": "https://github.com/bytecodealliance/wit-deps", diff --git a/src/wit-deps/install.sh b/src/wit-deps/install.sh index 7318beb..24b2e33 100644 --- a/src/wit-deps/install.sh +++ b/src/wit-deps/install.sh @@ -1,51 +1,93 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq -check curl ca-certificates jq +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest WIT Deps version from GitHub..." URL="https://api.github.com/repos/bytecodealliance/wit-deps/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://github.com/bytecodealliance/wit-deps/releases/download/v"${VERSION}"/wit-deps-x86_64-unknown-linux-musl" - if ! curl -sLf -o ./wit-deps-x86_64-unknown-linux-musl "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://github.com/bytecodealliance/wit-deps/releases/download/v${VERSION}/wit-deps-${ARCH}-unknown-linux-musl" + log "INFO" "Downloading WIT Deps from $URL" + + if ! curl -sLf --fail -o ./wit-deps "$URL"; then + log "ERROR" "Failed to download WIT Deps!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - chmod +x ./wit-deps-x86_64-unknown-linux-musl - chown root:root ./wit-deps-x86_64-unknown-linux-musl - mv ./wit-deps-x86_64-unknown-linux-musl /usr/local/bin/wit-deps +install_binary() { + log "INFO" "Installing WIT Deps..." + install -m 0755 ./wit-deps /usr/local/bin/wit-deps + log "INFO" "WIT Deps installed successfully to /usr/local/bin/wit-deps" } -echo "Activating feature 'wit-deps'" +log "INFO" "Activating feature 'wit-deps'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/src/zig/devcontainer-feature.json b/src/zig/devcontainer-feature.json index 1d109d3..6e1ff38 100644 --- a/src/zig/devcontainer-feature.json +++ b/src/zig/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "zig", - "version": "1.0.3", + "version": "1.1.0", "name": "Zig CLI", "description": "Command line tool (zig)", "documentationURL": "https://ziglang.org/learn", @@ -12,4 +12,4 @@ } }, "customizations": {} -} \ No newline at end of file +} diff --git a/src/zig/install.sh b/src/zig/install.sh index dd24eec..3f1d04b 100644 --- a/src/zig/install.sh +++ b/src/zig/install.sh @@ -1,53 +1,95 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(mktemp -d)" -check() { +log() { + local LEVEL="$1" + shift + echo "[$LEVEL] $*" +} + +check_deps() { + log "INFO" "Checking required dependencies: $*" + export DEBIAN_FRONTEND=noninteractive + if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." + if [ ! -f /var/lib/apt/lists/lock ]; then + log "INFO" "Running apt update..." apt update -y fi + log "INFO" "Installing missing dependencies: $*" apt -y install --no-install-recommends "$@" + else + log "INFO" "All required dependencies are already installed." fi } -export DEBIAN_FRONTEND=noninteractive +check_deps curl ca-certificates jq xz-utils -check curl ca-certificates jq xz-utils +get_version() { + VERSION="${VERSION:-latest}" -version() { - if [ "${VERSION}" = "latest" ]; then + if [ "$VERSION" = "latest" ]; then + log "INFO" "Fetching latest Zig version from GitHub..." URL="https://api.github.com/repos/ziglang/zig/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" + + if ! curl -sLf --fail -o ./response.json "$URL"; then + log "ERROR" "Unable to fetch latest version from GitHub API!" exit 1 fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') + + VERSION=$(jq -r ".tag_name" < ./response.json | sed 's/v//') + log "INFO" "Latest version found: v$VERSION" else - export VERSION=$(echo ${VERSION} | sed 's/v//') + VERSION=$(echo "$VERSION" | sed 's/v//') + log "INFO" "Using specified version: v$VERSION" fi + + export VERSION } -download() { - URL="https://ziglang.org/download/"${VERSION}"/zig-linux-x86_64-"${VERSION}".tar.xz" - if ! curl -sLf -o ./zig-linux-x86_64-"${VERSION}".tar.xz "$URL"; then - echo "ERROR: Unable to download file" +detect_arch() { + log "INFO" "Detecting system architecture..." + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) log "ERROR" "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + log "INFO" "Architecture detected: $ARCH" + export ARCH +} + +download_binary() { + if [ -z "$VERSION" ]; then + log "ERROR" "Missing version information!" exit 1 fi + + URL="https://ziglang.org/download/${VERSION}/zig-linux-${ARCH}-${VERSION}.tar.xz" + log "INFO" "Downloading Zig from $URL" + + if ! curl -sLf --fail -o ./zig-linux-${ARCH}-${VERSION}.tar.xz "$URL"; then + log "ERROR" "Failed to download Zig!" + exit 1 + fi + + log "INFO" "Download complete!" } -install() { - xz -d ./zig-linux-x86_64-"${VERSION}".tar.xz - tar -xof ./zig-linux-x86_64-"${VERSION}".tar - chmod +x ./zig-linux-x86_64-"${VERSION}"/zig - chown root:root ./zig-linux-x86_64-"${VERSION}"/zig - mv ./zig-linux-x86_64-"${VERSION}"/zig /usr/local/bin/zig +install_binary() { + log "INFO" "Installing Zig..." + xz -d ./zig-linux-${ARCH}-${VERSION}.tar.xz + tar -xof ./zig-linux-${ARCH}-${VERSION}.tar + install -m 0755 ./zig-linux-${ARCH}-${VERSION}/zig /usr/local/bin/zig + log "INFO" "Zig installed successfully to /usr/local/bin/zig" } -echo "Activating feature 'zig'" +log "INFO" "Activating feature 'zig'" + +get_version +detect_arch +download_binary +install_binary -version -download -install +log "INFO" "Installation complete!" diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json index c672350..9e35cd6 100644 --- a/test/_global/scenarios.json +++ b/test/_global/scenarios.json @@ -1,27 +1,22 @@ { "tools": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "argocd": {}, "atlas": {}, "bicep": {}, - "binaryen": {}, "calicoctl": {}, "cilium": {}, "clusterctl": {}, "deno": {}, "flux": {}, - "func": {}, "gcloud": {}, "helm": {}, "istioctl": {}, "kind": {}, "kubebuilder": {}, "kubectl": {}, - "mkcert": {}, - "pavex": {}, "pulumi": {}, - "rad": {}, "spin": {}, "task": {}, "wasm-tools": {}, diff --git a/test/_global/tools.sh b/test/_global/tools.sh index 941108f..a6d5e61 100644 --- a/test/_global/tools.sh +++ b/test/_global/tools.sh @@ -9,23 +9,18 @@ source dev-container-features-test-lib check "argocd" argocd version --client --output json check "atlas" atlas --version check "bicep" bicep --version -check "binaryen" wasm2js --version check "calicoctl" calicoctl version check "cilium" cilium version --client check "clusterctl" clusterctl version check "deno" deno --version check "flux" flux version --client --output json -check "func" func version check "gcloud" gcloud version check "helm" helm version check "istioctl" istioctl version --remote=false check "kind" kind version check "kubebuilder" kubebuilder version check "kubectl" kubectl version --client=true --output=json -check "mkcert" mkcert --version -check "pavex" pavex --version check "pulumi" pulumi version -check "rad" rad version check "spin" spin --version check "task" task --version check "wasm-tools" wasm-tools --version diff --git a/test/argocd/scenarios.json b/test/argocd/scenarios.json index 62334e7..934fae4 100644 --- a/test/argocd/scenarios.json +++ b/test/argocd/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "argocd": { - "version": "2.8.2" + "version": "2.14.1" } } } -} \ No newline at end of file +} diff --git a/test/argocd/version.sh b/test/argocd/version.sh index 417550c..16339dc 100644 --- a/test/argocd/version.sh +++ b/test/argocd/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" argocd version --client --output json | grep "2.8.2" +check "version" argocd version --client --output json | grep "2.14.1" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/atlas/scenarios.json b/test/atlas/scenarios.json index 4857356..e35e422 100644 --- a/test/atlas/scenarios.json +++ b/test/atlas/scenarios.json @@ -1,6 +1,6 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "atlas": { @@ -8,4 +8,4 @@ } } } -} \ No newline at end of file +} diff --git a/test/atlas/version.sh b/test/atlas/version.sh index 8380ac2..a4c0244 100644 --- a/test/atlas/version.sh +++ b/test/atlas/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests check "version" atlas --version | grep "1.37.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/bicep/scenarios.json b/test/bicep/scenarios.json index a5e4759..6453965 100644 --- a/test/bicep/scenarios.json +++ b/test/bicep/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "bicep": { - "version": "0.24.24" + "version": "0.33.93" } } } -} \ No newline at end of file +} diff --git a/test/bicep/version.sh b/test/bicep/version.sh index 4714da8..ce086a5 100644 --- a/test/bicep/version.sh +++ b/test/bicep/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" bicep --version | grep "0.24.24" +check "version" bicep --version | grep "0.33.93" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/binaryen/scenarios.json b/test/binaryen/scenarios.json deleted file mode 100644 index 4caa60c..0000000 --- a/test/binaryen/scenarios.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", - "user": "vscode", - "features": { - "binaryen": { - "version": "version_117" - } - } - } -} \ No newline at end of file diff --git a/test/binaryen/test.sh b/test/binaryen/test.sh deleted file mode 100644 index ab8d30d..0000000 --- a/test/binaryen/test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -# Import test library -source dev-container-features-test-lib - -# Feature-specific tests -check "wasm2js" wasm2js --version -check "wasm-as" wasm-as --version -check "wasm-ctor-eval" wasm-ctor-eval --version -check "wasm-dis" wasm-dis --version -check "wasm-emscripten-finalize" wasm-emscripten-finalize --version -check "wasm-fuzz-lattices" wasm-fuzz-lattices --version -check "wasm-fuzz-types" wasm-fuzz-types --version -check "wasm-merge" wasm-merge --version -check "wasm-metadce" wasm-metadce --version -check "wasm-opt" wasm-opt --version -check "wasm-reduce" wasm-reduce --version -check "wasm-shell" wasm-shell --version -check "wasm-split" wasm-split --version - -# Report result -reportResults diff --git a/test/binaryen/version.sh b/test/binaryen/version.sh deleted file mode 100644 index c1355ea..0000000 --- a/test/binaryen/version.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e - -# Import test library -source dev-container-features-test-lib - -# Check the user -check "vscode" whoami | grep vscode - -# Options-specific tests -check "wasm2js" wasm2js --version | grep "version_117" -check "wasm-as" wasm-as --version | grep "version_117" -check "wasm-ctor-eval" wasm-ctor-eval --version | grep "version_117" -check "wasm-dis" wasm-dis --version | grep "version_117" -check "wasm-emscripten-finalize" wasm-emscripten-finalize --version | grep "version_117" -check "wasm-fuzz-lattices" wasm-fuzz-lattices --version | grep "version_117" -check "wasm-fuzz-types" wasm-fuzz-types --version | grep "version_117" -check "wasm-merge" wasm-merge --version | grep "version_117" -check "wasm-metadce" wasm-metadce --version | grep "version_117" -check "wasm-opt" wasm-opt --version | grep "version_117" -check "wasm-reduce" wasm-reduce --version | grep "version_117" -check "wasm-shell" wasm-shell --version | grep "version_117" -check "wasm-split" wasm-split --version | grep "version_117" - -# Report result -reportResults diff --git a/test/calicoctl/scenarios.json b/test/calicoctl/scenarios.json index 5a86e3a..91b12e1 100644 --- a/test/calicoctl/scenarios.json +++ b/test/calicoctl/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "calicoctl": { - "version": "v3.26.2" + "version": "3.29.1" } } } -} \ No newline at end of file +} diff --git a/test/calicoctl/version.sh b/test/calicoctl/version.sh index 17d66c4..c42b920 100644 --- a/test/calicoctl/version.sh +++ b/test/calicoctl/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" calicoctl version | grep "v3.26.2" +check "version" calicoctl version | grep "3.29.1" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/cilium/scenarios.json b/test/cilium/scenarios.json index eed51cf..8ca5462 100644 --- a/test/cilium/scenarios.json +++ b/test/cilium/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "cilium": { - "version": "v0.15.20" + "version": "0.16.24" } } } -} \ No newline at end of file +} diff --git a/test/cilium/version.sh b/test/cilium/version.sh index ec2b476..d016b59 100644 --- a/test/cilium/version.sh +++ b/test/cilium/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" cilium version --client | grep "v0.15.20" +check "version" cilium version --client | grep "0.16.24" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/clusterctl/scenarios.json b/test/clusterctl/scenarios.json index fab811a..828070f 100644 --- a/test/clusterctl/scenarios.json +++ b/test/clusterctl/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "clusterctl": { - "version": "1.5.1" + "version": "1.9.4" } } } -} \ No newline at end of file +} diff --git a/test/clusterctl/version.sh b/test/clusterctl/version.sh index 52ab0f4..7b0575c 100644 --- a/test/clusterctl/version.sh +++ b/test/clusterctl/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" clusterctl version | grep "1.5.1" +check "version" clusterctl version | grep "1.9.4" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/deno/scenarios.json b/test/deno/scenarios.json index d9a05a6..88b2608 100644 --- a/test/deno/scenarios.json +++ b/test/deno/scenarios.json @@ -1,10 +1,10 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "deno": { - "version": "v1.43.5" + "version": "v2.1.9" } } } diff --git a/test/deno/version.sh b/test/deno/version.sh index 4216933..7c2b837 100644 --- a/test/deno/version.sh +++ b/test/deno/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" deno --version | grep "1.43.5" +check "version" deno --version | grep "2.1.9" # Report result reportResults diff --git a/test/flux/scenarios.json b/test/flux/scenarios.json index 6b6c4fe..e036a2a 100644 --- a/test/flux/scenarios.json +++ b/test/flux/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "flux": { - "version": "2.1.0" + "version": "2.4.0" } } } -} \ No newline at end of file +} diff --git a/test/flux/version.sh b/test/flux/version.sh index 3de83f2..455e124 100644 --- a/test/flux/version.sh +++ b/test/flux/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" flux version --client --output json | grep "2.1.0" +check "version" flux version --client --output json | grep "2.4.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/gcloud/scenarios.json b/test/gcloud/scenarios.json index 6cdfba5..f3f0879 100644 --- a/test/gcloud/scenarios.json +++ b/test/gcloud/scenarios.json @@ -1,19 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "gcloud": { - "version": "505.0.0", - "update": false + "version": "508.0.0" } } - }, - "update": { - "image": "mcr.microsoft.com/devcontainers/base:debian", - "user": "vscode", - "features": { - "gcloud": {} - } } } diff --git a/test/gcloud/update.sh b/test/gcloud/update.sh deleted file mode 100644 index f0bf115..0000000 --- a/test/gcloud/update.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -# Import test library -source dev-container-features-test-lib - -# Check the user -check "vscode" whoami | grep vscode - -# Options-specific tests -check "version" gcloud version - -# Report result -reportResults diff --git a/test/gcloud/version.sh b/test/gcloud/version.sh index 2c15e45..f535de9 100644 --- a/test/gcloud/version.sh +++ b/test/gcloud/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" gcloud version | grep "505.0.0" +check "version" gcloud version | grep "508.0.0" # Report result reportResults diff --git a/test/helm/scenarios.json b/test/helm/scenarios.json index ed0b3ec..3b3bdb2 100644 --- a/test/helm/scenarios.json +++ b/test/helm/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "helm": { - "version": "3.12.3" + "version": "3.17.0" } } } -} \ No newline at end of file +} diff --git a/test/helm/version.sh b/test/helm/version.sh index 039136d..919712a 100644 --- a/test/helm/version.sh +++ b/test/helm/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" helm version | grep "3.12.3" +check "version" helm version | grep "3.17.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/istioctl/scenarios.json b/test/istioctl/scenarios.json index fa33956..9239f77 100644 --- a/test/istioctl/scenarios.json +++ b/test/istioctl/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "istioctl": { - "version": "1.18.2" + "version": "1.24.2" } } } -} \ No newline at end of file +} diff --git a/test/istioctl/version.sh b/test/istioctl/version.sh index 6fcf891..f5faa30 100644 --- a/test/istioctl/version.sh +++ b/test/istioctl/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" istioctl version --remote=false | grep "1.18.2" +check "version" istioctl version --remote=false | grep "1.24.2" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/kind/scenarios.json b/test/kind/scenarios.json index 4f53ac2..d71e570 100644 --- a/test/kind/scenarios.json +++ b/test/kind/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "kind": { - "version": "0.20.0" + "version": "0.26.0" } } } -} \ No newline at end of file +} diff --git a/test/kind/version.sh b/test/kind/version.sh index 1b94354..12f60c2 100644 --- a/test/kind/version.sh +++ b/test/kind/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" kind version | grep "0.20.0" +check "version" kind version | grep "0.26.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/kubebuilder/scenarios.json b/test/kubebuilder/scenarios.json index 43b69ab..d692308 100644 --- a/test/kubebuilder/scenarios.json +++ b/test/kubebuilder/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "kubebuilder": { - "version": "3.11.1" + "version": "4.5.0" } } } -} \ No newline at end of file +} diff --git a/test/kubebuilder/version.sh b/test/kubebuilder/version.sh index d91dad3..21b1c14 100644 --- a/test/kubebuilder/version.sh +++ b/test/kubebuilder/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" kubebuilder version | grep "3.11.1" +check "version" kubebuilder version | grep "4.5.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/kubectl/scenarios.json b/test/kubectl/scenarios.json index ea246b8..ba3e2d1 100644 --- a/test/kubectl/scenarios.json +++ b/test/kubectl/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "kubectl": { - "version": "1.28.1" + "version": "1.32.1" } } } -} \ No newline at end of file +} diff --git a/test/kubectl/test.sh b/test/kubectl/test.sh index 9cbc16a..c0350ed 100644 --- a/test/kubectl/test.sh +++ b/test/kubectl/test.sh @@ -8,8 +8,5 @@ source dev-container-features-test-lib # Feature-specific tests check "version" kubectl version --client=true --output=json -# Options-specific tests -check "kubelogin" kubelogin --version - # Report result reportResults diff --git a/test/kubectl/version.sh b/test/kubectl/version.sh index 26d9d01..bdb461a 100644 --- a/test/kubectl/version.sh +++ b/test/kubectl/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" kubectl version --client=true --output=json | grep "1.28.1" +check "version" kubectl version --client=true --output=json | grep "1.32.1" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/pulumi/scenarios.json b/test/pulumi/scenarios.json index a00b6cc..d058238 100644 --- a/test/pulumi/scenarios.json +++ b/test/pulumi/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "pulumi": { - "version": "3.80.0" + "version": "3.148.0" } } } -} \ No newline at end of file +} diff --git a/test/pulumi/version.sh b/test/pulumi/version.sh index 0295843..94b01b8 100644 --- a/test/pulumi/version.sh +++ b/test/pulumi/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" pulumi version | grep "3.80.0" +check "version" pulumi version | grep "3.148.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/spin/scenarios.json b/test/spin/scenarios.json index 12282f1..d027430 100644 --- a/test/spin/scenarios.json +++ b/test/spin/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "spin": { - "version": "1.4.2" + "version": "3.1.2" } } } -} \ No newline at end of file +} diff --git a/test/spin/version.sh b/test/spin/version.sh index 40e0899..2557559 100644 --- a/test/spin/version.sh +++ b/test/spin/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" spin --version | grep "1.4.2" +check "version" spin --version | grep "3.1.2" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/task/scenarios.json b/test/task/scenarios.json index ac0a551..9fe2598 100644 --- a/test/task/scenarios.json +++ b/test/task/scenarios.json @@ -1,10 +1,10 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "task": { - "version": "3.39.2" + "version": "3.41.0" } } } diff --git a/test/task/version.sh b/test/task/version.sh index b0510b1..d514bd8 100644 --- a/test/task/version.sh +++ b/test/task/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" task --version | grep "3.39.2" +check "version" task --version | grep "3.41.0" # Report result reportResults diff --git a/test/wasm-tools/scenarios.json b/test/wasm-tools/scenarios.json index 74ebad0..48f3d4d 100644 --- a/test/wasm-tools/scenarios.json +++ b/test/wasm-tools/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "wasm-tools": { - "version": "1.200.0" + "version": "1.224.0" } } } -} \ No newline at end of file +} diff --git a/test/wasm-tools/version.sh b/test/wasm-tools/version.sh index 0f7b6cf..9773151 100644 --- a/test/wasm-tools/version.sh +++ b/test/wasm-tools/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" wasm-tools --version | grep "1.200.0" +check "version" wasm-tools --version | grep "1.224.0" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/wasmtime/scenarios.json b/test/wasmtime/scenarios.json index d6b5499..0db8273 100644 --- a/test/wasmtime/scenarios.json +++ b/test/wasmtime/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "wasmtime": { - "version": "12.0.1" + "version": "29.0.1" } } } -} \ No newline at end of file +} diff --git a/test/wasmtime/version.sh b/test/wasmtime/version.sh index 11d7020..dc9b9b7 100644 --- a/test/wasmtime/version.sh +++ b/test/wasmtime/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" wasmtime --version | grep "12.0.1" +check "version" wasmtime --version | grep "29.0.1" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/wit-bindgen/scenarios.json b/test/wit-bindgen/scenarios.json index 73abc29..4926ba0 100644 --- a/test/wit-bindgen/scenarios.json +++ b/test/wit-bindgen/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "wit-bindgen": { - "version": "0.21.0" + "version": "0.38.0" } } } -} \ No newline at end of file +} diff --git a/test/wit-bindgen/version.sh b/test/wit-bindgen/version.sh index 6bc8f01..aa9a3dc 100644 --- a/test/wit-bindgen/version.sh +++ b/test/wit-bindgen/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" wit-bindgen --version | grep "0.21.0" +check "version" wit-bindgen --version | grep "0.38.0" # Report result reportResults diff --git a/test/wit-deps/scenarios.json b/test/wit-deps/scenarios.json index 5e1f3b7..52b7e6b 100644 --- a/test/wit-deps/scenarios.json +++ b/test/wit-deps/scenarios.json @@ -1,10 +1,10 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "wit-deps": { - "version": "0.3.5" + "version": "0.5.0" } } } diff --git a/test/wit-deps/version.sh b/test/wit-deps/version.sh index 37cea59..4db6956 100644 --- a/test/wit-deps/version.sh +++ b/test/wit-deps/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" wit-deps --version | grep "0.3.5" +check "version" wit-deps --version | grep "0.5.0" # Report result reportResults diff --git a/test/zig/scenarios.json b/test/zig/scenarios.json index 62309bc..785b610 100644 --- a/test/zig/scenarios.json +++ b/test/zig/scenarios.json @@ -1,11 +1,11 @@ { "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "user": "vscode", "features": { "zig": { - "version": "0.11.0" + "version": "0.13.0" } } } -} \ No newline at end of file +} diff --git a/test/zig/version.sh b/test/zig/version.sh index ec6464f..8ccb021 100644 --- a/test/zig/version.sh +++ b/test/zig/version.sh @@ -6,10 +6,10 @@ set -e source dev-container-features-test-lib # Check the user -check "vscode" whoami | grep vscode +check "whoami" whoami | grep vscode # Options-specific tests -check "version" zig version | grep "0.11.0" +check "version" zig version | grep "0.13.0" # Report result -reportResults \ No newline at end of file +reportResults