Skip to content

Commit 8aa1cff

Browse files
authored
finish aws-sam template (#29)
1 parent 5ed72da commit 8aa1cff

File tree

12 files changed

+563
-23
lines changed

12 files changed

+563
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.db
22
gggtracker
3+
/server/bindata.go
34
/vendor

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN wget -O - https://raw.githubusercontent.com/golang/dep/master/install.sh | s
77

88
ADD . .
99
RUN dep ensure
10+
RUN go generate ./...
1011
RUN go vet . && go test -v ./...
1112
RUN go build .
1213

Gopkg.lock

Lines changed: 70 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is the repository for [gggtracker.com](https://gggtracker.com). If there's
44

55
### Development
66

7-
If you have Go installed, you can develop and run the server in the usual way: `go get ./... && go run main.go`
7+
If you have Go installed, you can develop and run the server in the usual way: `go get ./... && go generate ./... && go run main.go`
88

99
![Development](development.gif)
1010

aws-sam/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/dist.zip

aws-sam/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.PHONY: build build-environment-build lambda-environment-build
2+
3+
dist.zip: build
4+
zip -j dist.zip build/main
5+
6+
build:
7+
dep ensure
8+
go generate ../...
9+
docker-compose run --rm build-environment make build-environment-build
10+
docker-compose run --rm lambda-environment make lambda-environment-build
11+
12+
build-environment-build:
13+
rm -rf ./build
14+
go build -o ./build/main .
15+
./build/main --help
16+
17+
lambda-environment-build:
18+
./build/main --help || (ldd ./build/main && exit 1)

aws-sam/docker-compose.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
services:
3+
build-environment:
4+
image: golang:1.11
5+
volumes:
6+
- ../:/go/src/github.com/ccbrown/gggtracker
7+
working_dir: /go/src/github.com/ccbrown/gggtracker/aws-sam
8+
lambda-environment:
9+
entrypoint: []
10+
environment:
11+
LD_LIBRARY_PATH: ''
12+
image: lambci/lambda:go1.x
13+
volumes:
14+
- ../:/go/src/github.com/ccbrown/gggtracker
15+
working_dir: /go/src/github.com/ccbrown/gggtracker/aws-sam

0 commit comments

Comments
 (0)