Skip to content

Commit

Permalink
add localstack
Browse files Browse the repository at this point in the history
  • Loading branch information
NafiAsib committed Mar 20, 2024
1 parent d508840 commit bd41ed0
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- pack-cli
- mirrord
- aws-sam-cli
- localstack
steps:
- uses: actions/checkout@v3
- name: "Install latest devcontainer CLI"
Expand Down
9 changes: 9 additions & 0 deletions src/localstack/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "localstack",
"id": "localstack",
"version": "1.0.0",
"description": "LocalStack is a cloud service emulator",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
16 changes: 16 additions & 0 deletions src/localstack/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -eax

ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then ARCH=arm64; fi

install_localstack() {
echo "Installing Localstack..."
LATEST_VERSION=$(curl https://api.github.com/repos/localstack/localstack/releases/latest | grep -i "tag_name" | awk -F '"' '{print $4}' | sed 's/v//g')
curl -Lo localstack-cli-${LATEST_VERSION}-linux-${ARCH}-onefile.tar.gz \
https://github.com/localstack/localstack-cli/releases/download/v${LATEST_VERSION}/localstack-cli-${LATEST_VERSION}-linux-${ARCH}-onefile.tar.gz
tar xvzf localstack-cli-${LATEST_VERSION}-linux-*-onefile.tar.gz -C /usr/local/bin
}

install_localstack
17 changes: 17 additions & 0 deletions test/localstack/available_for_nonroot_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

source dev-container-features-test-lib

check "user is vscode" grep vscode <(whoami)

bins=(
localstack
)

for bin in "${bins[@]}"; do
check "$bin" command -v "$bin"
done

reportResults
12 changes: 12 additions & 0 deletions test/localstack/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"available_for_nonroot_user": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode"
},
"localstack": {}
}
}
}

0 comments on commit bd41ed0

Please sign in to comment.