Skip to content

Commit

Permalink
Merge pull request #30 from nao1215/feat/introduce-localstack-CI
Browse files Browse the repository at this point in the history
Introduce localstack pro into GitHub Actions(CI)
  • Loading branch information
nao1215 authored Jan 8, 2024
2 parents 1a82759 + 0cf3a21 commit 81047d1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ jobs:
go-version: "1"
check-latest: true

- name: Setup localstack
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
# https://docs.localstack.cloud/user-guide/ci/github-actions/
run: |
docker compose up -d
echo "Waiting for LocalStack startup..."
sleep 30
echo "Startup complete"
- name: Download dependencies
run: go mod download

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ data
localstack
/s3hub
/spare
.envrc
5 changes: 4 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
services:
localstack:
container_name: "rainbow-localstack"
image: localstack/localstack:latest
image: localstack/localstack-pro:latest
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN- }
- DEBUG=${DEBUG-}
- DOCKER_HOST=unix:///var/run/docker.sock
- DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM='.*cloudfront\.net'
- CLOUDFRONT_STATIC_PORTS= 1
volumes:
- "${LOCALSTACK_VOLUME_DIR:-./localstack}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
Expand Down
6 changes: 6 additions & 0 deletions doc/common/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ aws_secret_access_key=test
> [!NOTE]
> Alternatively, you can also set the AWS_PROFILE=localstack environment variable, in which case the --profile localstack parameter can be omitted in the commands above.

### localstack subscriptions
Please access the official website of [localstack](https://www.localstack.cloud/) and obtain a Hobby Subscription. Then, you can get the authentication token from the localstack dashboard. Finally, set the LOCALSTACK_AUTH_TOKEN environment variable. You must not upload the LOCALSTACK_AUTH_TOKEN to the remote repository.
```shell
export LOCALSTACK_AUTH_TOKEN=YOUR_AUTH_TOKEN
```

### Run localstack
Run the following command to start localstack:
```shell
Expand Down

0 comments on commit 81047d1

Please sign in to comment.