-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMakefile
74 lines (56 loc) · 2.3 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
SHELL = /bin/bash -eo pipefail
GORELEASER_VERSION = "v1.19.2"
GO_LICENSER_VERSION = "v0.4.0"
GOLANGCI_LINT_VERSION = "v1.59.1"
export DOCKER_IMAGE_NAME = observability/apm-lambda-extension
export DOCKER_REGISTRY = docker.elastic.co
clean:
@rm -rf dist/
@docker image ls "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME)*" -aq | xargs -I {} docker rmi --force {} || true
.PHONY: dist
dist:
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --snapshot --clean
.PHONY: zip
zip:
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --snapshot --clean --skip-docker
build:
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) build --snapshot --clean
.PHONY: release
release:
go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --clean
.PHONY: release-notes
release-notes:
@./.ci/release-github.sh
.PHONY: test
test:
@go run gotest.tools/[email protected] --format testname --junitfile $(junitfile)
.PHONY: lint-prep
lint-prep:
@go mod tidy && git diff --exit-code
.PHONY: lint
lint:
@if [ "$(CI)" != "" ]; then go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) version; fi
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --build-tags tools
NOTICE.txt: go.mod
@bash ./scripts/notice.sh
.PHONY: check-linceses
check-licenses:
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing .
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing -ext .java .
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing -ext .js .
.PHONY: check-notice
check-notice:
$(MAKE) NOTICE.txt
@git diff --exit-code --quiet NOTICE.txt && exit 0 || echo "regenerate NOTICE.txt" && exit 1
##############################################################################
# Smoke tests -- Basic smoke tests for the APM Lambda extension
##############################################################################
SMOKETEST_VERSIONS ?= latest
.PHONY: smoketest/run
smoketest/run: zip
@echo "-> Running smoke tests for version $${version}..."
cd testing/smoketest && ./test.sh $${version}
.PHONY: smoketest/cleanup
smoketest/cleanup: zip
@echo "-> Running cleanup"
cd testing/smoketest && ./cleanup.sh