forked from awslabs/ssosync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 990 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
52
OUTPUT = main # Referenced as Handler in template.yaml
RELEASER = goreleaser
PACKAGED_TEMPLATE = packaged.yaml
STACK_NAME := $(STACK_NAME)
S3_BUCKET := $(S3_BUCKET)
S3_PREFIX := $(S3_PREFIX)
TEMPLATE = template.yaml
APP_NAME ?= ssosync
.PHONY: test
test:
go test ./...
.PHONY: go-build
go-build:
go build -o $(APP_NAME) main.go
.PHONY: clean
clean:
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)
.PHONY: install
install:
go get ./...
main: main.go
goreleaser build --snapshot --rm-dist
# compile the code to run in Lambda (local or real)
.PHONY: lambda
lambda:
$(MAKE) main
.PHONY: build
build: clean lambda
.PHONY: api
api: build
sam local start-api
.PHONY: publish
publish:
sam publish -t packaged.yaml
.PHONY: package
package: build
sam package --s3-bucket $(S3_BUCKET) --output-template-file $(PACKAGED_TEMPLATE) --s3-prefix $(S3_PREFIX)
.PHONY: deploy
deploy: package
sam deploy --stack-name $(STACK_NAME) --template-file $(PACKAGED_TEMPLATE) --capabilities CAPABILITY_IAM