From 83bdcf342eb8b6c4916fe63c3ea534dac4672928 Mon Sep 17 00:00:00 2001 From: lakkeger Date: Mon, 5 Aug 2024 07:32:26 +0000 Subject: [PATCH 1/7] fix: add 3.6.0 into proposals --- src/localstack-cli/devcontainer-feature.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/localstack-cli/devcontainer-feature.json b/src/localstack-cli/devcontainer-feature.json index 1d7422d..e69adfb 100644 --- a/src/localstack-cli/devcontainer-feature.json +++ b/src/localstack-cli/devcontainer-feature.json @@ -13,6 +13,7 @@ "lts", "latest", "stable", + "3.6.0", "3.5.0", "3.4.0", "3.3.0", From 6087a0647aca70738a601802ffc1f8f43751524a Mon Sep 17 00:00:00 2001 From: lakkeger Date: Mon, 5 Aug 2024 07:32:56 +0000 Subject: [PATCH 2/7] feat: add soft dependencies for related tools --- src/localstack-cli/devcontainer-feature.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/localstack-cli/devcontainer-feature.json b/src/localstack-cli/devcontainer-feature.json index e69adfb..09396a8 100644 --- a/src/localstack-cli/devcontainer-feature.json +++ b/src/localstack-cli/devcontainer-feature.json @@ -58,6 +58,11 @@ }, "installsAfter": [ "ghcr.io/devcontainers/features/python", - "ghcr.io/devcontainers/features/node" + "ghcr.io/devcontainers/features/node", + "ghcr.io/devcontainers/features/aws-cli", + "ghcr.io/devcontainers-contrib/features/aws-cdk", + "ghcr.io/customink/codespaces-features/sam-cli", + "ghcr.io/devcontainers-contrib/features/pulumi", + "ghcr.io/devcontainers/features/terraform" ] } From af126522f2c2014b9b4e0140800714b072dcbac9 Mon Sep 17 00:00:00 2001 From: lakkeger Date: Mon, 5 Aug 2024 11:39:20 +0000 Subject: [PATCH 3/7] docs: add note about tool installs --- src/localstack-cli/NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/localstack-cli/NOTES.md b/src/localstack-cli/NOTES.md index 36d2c31..b3ab530 100644 --- a/src/localstack-cli/NOTES.md +++ b/src/localstack-cli/NOTES.md @@ -6,4 +6,5 @@ This Feature should work on recent versions of Debian/Ubuntu-based distributions `bash` is required to execute the `install.sh` script. -`cdklocal` option requires `npm` to be installed which is not handled by this feature. All other tools are installed by `pipx` which is installed via package manager or the Python installation. The latter can be combined with the Python feature. \ No newline at end of file +`cdklocal` option requires `npm` to be installed which is not handled by this feature. All other tools are installed by `pipx` which is installed via package manager or the Python installation. The latter can be combined with the Python feature. +None of the wrapped tool(s) (ie Terraform, Pulumi or AWS CLI...etc), are handled by this feature, to install the underlying tool(s) please use the respective feature from the [DevContainer Feature Community Index](https://containers.dev/features). \ No newline at end of file From 6d676e1b4f237e1a2462a12fe8034ac8e14db0ca Mon Sep 17 00:00:00 2001 From: lakkeger Date: Mon, 5 Aug 2024 11:39:49 +0000 Subject: [PATCH 4/7] feat: add backports repo for new packages --- src/localstack-cli/install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) mode change 100644 => 100755 src/localstack-cli/install.sh diff --git a/src/localstack-cli/install.sh b/src/localstack-cli/install.sh old mode 100644 new mode 100755 index 8188fa2..f03a1e5 --- a/src/localstack-cli/install.sh +++ b/src/localstack-cli/install.sh @@ -72,11 +72,25 @@ pkg_mgr_update() { esac } +add_backports() { + case ${ID} in + debian) + echo "deb http://ftp.debian.org/debian ${VERSION_CODENAME}-backports main" | + tee /etc/apt/sources.list.d/backports.list + ;; + ubuntu) + echo "deb http://archive.ubuntu.com/ubuntu ${VERSION_CODENAME}-backports main" | + tee /etc/apt/sources.list.d/backports.list + ;; + esac +} + # Checks if packages are installed and installs them if not check_packages() { case ${ADJUSTED_ID} in debian) if ! dpkg -s "$@" > /dev/null 2>&1; then + add_backports pkg_mgr_update ${INSTALL_CMD} "$@" fi @@ -177,6 +191,8 @@ install_tools() { done } +add_backports + install_using_pip_strategy install_tools From 5d5d6874c51abc7ec4754f886186b01eb31c22c6 Mon Sep 17 00:00:00 2001 From: lakkeger Date: Mon, 5 Aug 2024 13:09:35 +0000 Subject: [PATCH 5/7] fix: add check for missing underlying tools --- src/localstack-cli/install.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/localstack-cli/install.sh b/src/localstack-cli/install.sh index f03a1e5..e2d17ee 100755 --- a/src/localstack-cli/install.sh +++ b/src/localstack-cli/install.sh @@ -171,11 +171,41 @@ install_with_complete_python_installation() { set -e } +warn() { + echo "WARNING: $1 not found on PATH, though local wrapper is being installed" +} + +is_tool() { + ! type $1 &> /dev/null + return $? +} + +check_tool() { + local tool=$(eval echo "\$$1") + case $tool in + awscli-local) + is_tool aws && warn awscli + ;; + aws-cdk-local) + is_tool cdk && warn aws-cdk + ;; + pulumi-local) + is_tool pulumi && warn pulumi + ;; + terraform-local) + (is_tool terraform || is_tool tofu) && warn terraform/tofu + ;; + aws-sam-cli-local) + is_tool sam && warn aws-sam-cli + ;; + esac +} + install_tool() { local tool=$(eval echo "\$$1") case $tool in aws-cdk-local) - npm install -g $tool aws-cdk + npm install -g $tool ;; *) PIPX_HOME="/usr/local/pipx" \ @@ -187,6 +217,7 @@ install_tool() { install_tools() { for tool in ${TOOLS[@]}; do + check_tool $tool install_tool $tool done } From bed0cf2f7268cfa6c116b7925f52466cf005958c Mon Sep 17 00:00:00 2001 From: lakkeger Date: Thu, 8 Aug 2024 08:39:53 +0200 Subject: [PATCH 6/7] feat: add focal and bullseye scenarios --- test/localstack-cli/scenarios.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/localstack-cli/scenarios.json b/test/localstack-cli/scenarios.json index d03ee0a..621f07d 100644 --- a/test/localstack-cli/scenarios.json +++ b/test/localstack-cli/scenarios.json @@ -1,6 +1,6 @@ { "version_lts": { - "image": "mcr.microsoft.com/devcontainers/base:bookworm", + "image": "mcr.microsoft.com/devcontainers/base:bullseye", "user": "vscode", "features": { "localstack-cli": { @@ -9,7 +9,7 @@ } }, "version_none": { - "image": "mcr.microsoft.com/devcontainers/base:jammy", + "image": "mcr.microsoft.com/devcontainers/base:focal", "user": "vscode", "features": { "localstack-cli": { From 6a86db22417a10c67c69ba6e489d43a47ec1821b Mon Sep 17 00:00:00 2001 From: lakkeger Date: Thu, 8 Aug 2024 09:09:01 +0200 Subject: [PATCH 7/7] fix: change section on tools to note for better visibility --- src/localstack-cli/NOTES.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/localstack-cli/NOTES.md b/src/localstack-cli/NOTES.md index b3ab530..dae03e9 100644 --- a/src/localstack-cli/NOTES.md +++ b/src/localstack-cli/NOTES.md @@ -6,5 +6,8 @@ This Feature should work on recent versions of Debian/Ubuntu-based distributions `bash` is required to execute the `install.sh` script. -`cdklocal` option requires `npm` to be installed which is not handled by this feature. All other tools are installed by `pipx` which is installed via package manager or the Python installation. The latter can be combined with the Python feature. -None of the wrapped tool(s) (ie Terraform, Pulumi or AWS CLI...etc), are handled by this feature, to install the underlying tool(s) please use the respective feature from the [DevContainer Feature Community Index](https://containers.dev/features). \ No newline at end of file +`cdklocal` option requires `npm` to be installed which is not handled by this feature. +All other tools are installed by `pipx` which is installed via package manager or the Python installation. The latter can be combined with the Python feature. + +> [!NOTE] +> None of the wrapped tool(s) (ie Terraform, Pulumi or AWS CLI...etc), are handled by this feature, to install the underlying tool(s) please use the respective feature from the [DevContainer Feature Community Index](https://containers.dev/features). \ No newline at end of file