Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve our app to prep for lambdas. #113

Merged
merged 10 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions .github/workflows/go_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: custom health check of the dynamo container badpokerface
run: curl http://127.0.0.1:18079 || (sleep 5s && curl http://127.0.0.1:18079 || (sleep 5s && curl http://127.0.0.1:18079 || (sleep 5s && curl http://127.0.0.1:18079)))
- name: Create dynamoDB table
run: aws dynamodb create-table --endpoint-url http://127.0.0.1:18079 --billing-mode PAY_PER_REQUEST --region us-west-2 --table-name cribbage --attribute-definitions AttributeName=DDBid,AttributeType=S AttributeName=spec,AttributeType=S --key-schema AttributeName=DDBid,KeyType=HASH AttributeName=spec,KeyType=Range
run: aws dynamodb create-table --endpoint-url http://127.0.0.1:18079 --billing-mode PAY_PER_REQUEST --region us-west-2 --table-name cribbage --attribute-definitions AttributeName=gamesV1,AttributeType=S AttributeName=spec,AttributeType=S --key-schema AttributeName=gamesV1,KeyType=HASH AttributeName=spec,KeyType=Range
- name: Run Golang Tests
run: go-acc -o coverage.txt ./...
- name: Upload coverage to Codecov
Expand All @@ -50,20 +50,3 @@ jobs:
# env_vars: OS,PYTHON
# name: codecov-umbrella
fail_ci_if_error: true
dockerimage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out code

- uses: docker/build-push-action@v1
name: Build and Push Docker image
with:
repository: joshprzybyszewski/cribbage
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_with_ref: true
add_git_labels: true
tag_with_sha: false
cache_froms: joshprzybyszewski/cribbage:latest
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ serve: ## Sets up the server locally with default options
go run -tags=prod main.go --dsn_user="$(DSN_USER)" --dsn_password="$(DSN_PW)" --dsn_host="$(DSN_HOST)"

.PHONY: lambda
lambda:
lambda: ## Builds the app so that we can serve it in a lambda
GOOS=linux CGO_ENABLED=0 go build -o cribbage-lambda -tags=prod main.go
zip cribbage-lambda.zip cribbage-lambda
rm cribbage-lambda
Expand All @@ -65,3 +65,9 @@ wasm: ## Builds the wasm output for the gowasm client
.PHONY: localstack
localstack: ## Runs the app as a local stack in docker-compose
docker-compose up -d cribbage-server

.PHONY: spa-bundle
spa-bundle: ## Builds the SPA bundle to deploy to AWS
cd client/ && npm run build && cd ..
mkdir -p infrastructure/spa-bundle/
cd client/build/ && zip -r ../../infrastructure/spa-bundle.zip . && cd ../..
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ make serve
make goclient
```

- From here, you should be directed through the game using [survey](https://github.com/AlecAivazis/survey).
- From here, you should be directed through the game using [survey](https://github.com/AlecAivazis/survey).

Happy Playing!

Expand Down
Loading