-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
42 lines (34 loc) · 1004 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
# SPDX-FileCopyrightText: 2022 - 2024 NRK
#
# SPDX-License-Identifier: MIT
BINARY_NAME := ./terraform-registry
CMD_SOURCE := ./cmd/terraform-registry
DOCKER_TAG := terraform-registry
.PHONY: all
all : reuse build test
.PHONY: build
build :
go build -ldflags "$(LD_FLAGS)" $(GO_FLAGS) -o $(BINARY_NAME) $(CMD_SOURCE)
.PHONY: build-docker
build-docker :
docker build . -t $(DOCKER_TAG)
.PHONY: test
test :
go test ./... -timeout 10s
.PHONY: run
run :
go run $(CMD_SOURCE)
.PHONY: reuse
reuse :
find . -type f \
| grep -vP '^(./.git|./.reuse|./LICENSES/|./terraform-registry)' \
| grep -vP '(/\.git/|/\.terraform/)' \
| grep -vP '(\\.tf)$$' \
| xargs reuse annotate --merge-copyrights --license MIT --copyright NRK --year `date +%Y` --skip-unrecognised
find . -type f -name '*.tf' \
| grep -vP '(/\.git/|/\.terraform/)' \
| xargs reuse annotate --merge-copyrights --license MIT --copyright NRK --year `date +%Y` --style python
.PHONY: clean
clean :
go clean
rm $(BINARY_NAME)