forked from gruntwork-io/terragrunt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (32 loc) · 1.39 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
# Some of the targets in this file were taken from the terraform project:
# https://github.com/hashicorp/terraform/blob/master/scripts/gofmtcheck.sh
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
help:
@echo "Various utilities for managing the terragrunt repository"
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
fmt:
@echo "Running source files through gofmt..."
gofmt -w $(GOFMT_FILES)
install-pre-commit-hook:
@if [ -f .git/hooks/pre-commit -o -L .git/hooks/pre-commit ]; then \
echo ""; \
echo "There is already a pre-commit hook installed. Remove it and run 'make"; \
echo "install-pre-commit-hook again, or manually alter it to add the contents"; \
echo "of 'scripts/pre-commit'."; \
echo ""; \
exit 1; \
fi
@ln -s scripts/pre-commit .git/hooks/pre-commit
@echo "pre-commit hook installed."
# This build target just for convenience for those building directly from
# source. See also: .circleci/config.yml
build: terragrunt
terragrunt: $(shell find . \( -type d -name 'vendor' -prune \) \
-o \( -type f -name '*.go' -print \) )
set -xe ;\
vtag_maybe_extra=$$(git describe --tags --abbrev=12 --dirty --broken) ;\
go build -o $@ -ldflags "-X github.com/gruntwork-io/go-commons/version.Version=$${vtag_maybe_extra} -extldflags '-static'" .
clean:
rm -f terragrunt
.PHONY: help fmtcheck fmt install-fmt-hook clean