-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 1.04 KB
/
Makefile
File metadata and controls
44 lines (31 loc) · 1.04 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
BINARY ?= deckhand
IMAGE ?= deckhand:test
CHART_DIR ?= charts/deckhand
HELM_RELEASE ?= deckhand
GO_BUILD_FLAGS ?= -trimpath
WEB_DEPS_STAMP := web/node_modules/.package-lock.stamp
.PHONY: build go-build test go-test web-build web-test docker-build helm-lint helm-template clean
build: go-build
go-build: web-build
CGO_ENABLED=0 go build $(GO_BUILD_FLAGS) -o $(BINARY) ./cmd/deckhand
test: web-build go-test web-test
go-test:
go test ./...
web-build: $(WEB_DEPS_STAMP)
npm --prefix web run build
web-test: $(WEB_DEPS_STAMP)
npm --prefix web run test -- --run
$(WEB_DEPS_STAMP): web/package.json web/package-lock.json
npm --prefix web ci
@mkdir -p $(dir $@)
@touch $@
docker-build:
docker build -t $(IMAGE) .
helm-lint:
@test -d $(CHART_DIR) || { echo "missing $(CHART_DIR); scaffold the Helm chart before linting" >&2; exit 1; }
helm lint $(CHART_DIR)
helm-template:
@test -d $(CHART_DIR) || { echo "missing $(CHART_DIR); scaffold the Helm chart before templating" >&2; exit 1; }
helm template $(HELM_RELEASE) $(CHART_DIR)
clean:
rm -f $(BINARY)