-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (47 loc) · 2.03 KB
/
Makefile
File metadata and controls
65 lines (47 loc) · 2.03 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
60
61
62
63
64
65
build: build-amd
build-amd:
GOOS=linux GOARCH=amd64 go build -o bin/x86_64/extensions/pyroscope-lambda-extension-x86_64 main.go
build-arm:
GOOS=linux GOARCH=arm64 go build -o bin/arm64/extensions/pyroscope-lambda-extension-amd64 main.go
.PHONY: clean
clean:
rm -Rf bin/
package-amd:
cd bin/x86_64 && zip -r extension.zip extensions
package-arm:
cd bin/arm64 && zip -r extension.zip extensions
build-GoExampleExtensionLayer:
GOOS=linux GOARCH=amd64 go build -o $(ARTIFACTS_DIR)/extensions/pyroscope-lambda-extension main.go
chmod +x $(ARTIFACTS_DIR)/extensions/pyroscope-lambda-extension
run-GoExampleExtensionLayer:
go run pyroscope-lambda-extension/main.go
.PHONY: publish-layer-dev
publish-layer-dev: build
cd bin && zip -r extension.zip extensions && aws lambda publish-layer-version --layer-name "pyroscope-extension-test" --region=us-east-1 --zip-file "fileb://extension.zip"
./scripts/replace-version.sh
.PHONY: lambda-build
lambda-build:
cd hello-world && sam build
.PHONY: lambda-local-invoke
lambda-local-invoke: lambda-build
cd hello-world && sam local invoke --region=us-east-1 --env-vars local.json --shutdown
.PHONY: lambda-local-start
lambda-local-start: lambda-build
cd hello-world && sam local start-lambda --region=us-east-1 --env-vars local.json
lambda-local-invoke-endpoint:
aws lambda invoke --function-name "HelloWorldFunction" --endpoint-url "http://127.0.0.1:3001" --no-verify-ssl out.txt --region=us-east-1
lambda-deploy:
cd hello-world && sam build && sam deploy --no-confirm-changeset
.PHONY: lint
lint: ## Run the lint across the codebase
go run "$(shell scripts/pinned-tools.sh github.com/mgechev/revive)" -config revive.toml -formatter stylish ./...
staticcheck -f stylish ./...
.PHONY: install-dev-tools
install-dev-tools: ## Install dev tools
cat tools/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI {} go install {}
.PHONY: test
test: ## Runs the test suite
go test -race $(shell go list ./...)
.PHONY: shellcheck
shellcheck: ## runs shellcheck against all script files
shellcheck ./scripts/*.sh