-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (39 loc) · 880 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Required Env
GO111MODULE=on
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
# General parameters
CURR_DIR=$(shell pwd)
# SAM parameters
SAM_BUILD_DIR=.aws-sam/build/
# Lambda handlers
alexa: ./lambdas/alexa/main.go
$(GOBUILD) -o $(SAM_BUILD_DIR)alexa ./lambdas/alexa
authentication: ./lambdas/authentication/main.go
$(GOBUILD) -o $(SAM_BUILD_DIR)authentication ./lambdas/authentication
.PHONY: lambda
lambda:
GOOS=linux GOARCH=amd64 $(MAKE) alexa
GOOS=linux GOARCH=amd64 $(MAKE) authentication
.PHONY: clean
clean:
rm -rfv $(SAM_BUILD_DIR)
mkdir $(SAM_BUILD_DIR)
.PHONY: build
build: clean lambda
cp template.yaml $(SAM_BUILD_DIR)
.PHONY: test
test:
$(GOTEST) -v ./...
.PHONY: run
run: build
sam local start-api
.PHONY: deploy
deploy: test build
sam deploy --guided
.PHONY: all
all: test build