Skip to content

Commit

Permalink
Merge pull request #13 from halprin/quality-of-life
Browse files Browse the repository at this point in the history
Quality of Life
  • Loading branch information
halprin authored Aug 22, 2021
2 parents bcd521f + 156163b commit 6cca4da
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
go-version: ^1.15
id: go

- name: Check out code into the Go module directory
- name: Check out code
uses: actions/checkout@v2

- name: Get dependencies
run: go get -v -t -d ./cmd/

- name: Build
run: go build -o delete-dynamodb-items -v ./cmd/
run: make compile
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
/delete-dynamodb-items

# Test binary, built with `go test -c`
*.test
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compile:
go build -o delete-dynamodb-items -v ./cmd/

runTestDynamoDB:
docker-compose -f dynamodb-docker-compose.yml up -d

loadTestData:
./generate_mass_data.sh 500
27 changes: 27 additions & 0 deletions dynamodb-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.8'
services:

dynamodb:
image: amazon/dynamodb-local
container_name: dynamodb
ports:
- "8002:8000"
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-inMemory"]
networks:
- dynamodb-net

dynamodb-admin:
image: aaronshaf/dynamodb-admin
container_name: dynamodb-admin
ports:
- "8001:8001"
environment:
- DYNAMO_ENDPOINT=http://dynamodb:8000
networks:
- dynamodb-net
depends_on:
- dynamodb

networks:
dynamodb-net:
name: dynamodb-net
2 changes: 1 addition & 1 deletion generate_mass_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ num_items="${1}"

table_name="mass-data"

aws dynamodb create-table --table-name "${table_name}" --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --endpoint-url http://127.0.0.1:8002
aws dynamodb create-table --table-name "${table_name}" --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --endpoint-url http://127.0.0.1:8002 --no-cli-pager

items_preamble="{\"${table_name}\": ["
items_middle=""
Expand Down

0 comments on commit 6cca4da

Please sign in to comment.