forked from awslabs/ssosync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (46 loc) · 1.18 KB
/
Makefile
File metadata and controls
59 lines (46 loc) · 1.18 KB
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
53
54
55
56
57
58
59
OUTPUT = bootstrap # Referenced as Handler in template.yaml
RELEASER = goreleaser
PACKAGED_TEMPLATE = packaged.yaml
STACK_NAME := ssosyncv2
S3_BUCKET := ssosync-source-code
S3_PREFIX := ssosync
TEMPLATE = template.yaml
APP_NAME ?= ssosync
.PHONY: test
test:
go test ./...
.PHONY: go-build
go-build:
go build -o $(APP_NAME) main.go
build-SSOSyncV2Function:
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
cp ./bootstrap $(ARTIFACTS_DIR)/.
.PHONY: clean
clean:
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)
rm -rf .aws-sam/
.PHONY: install
install:
go get ./...
# Build for Lambda (ARM64 Linux)
.PHONY: lambda-build
lambda-build:
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
# compile the code to run in Lambda (local or real)
.PHONY: lambda
lambda:
$(MAKE) lambda-build
.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