-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathMakefile
61 lines (47 loc) · 1.43 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
export PATH := ${HOME}/go/bin:/go/bin:${PATH}
DOCKER := $(or $(DOCKER),podman)
DEPS = npm go
CHECK := $(foreach dep,$(DEPS),\
$(if $(shell which $(dep)),"$(dep) found",$(error "Missing $(dep) in PATH")))
all: test build
build: builddir clean npm frontend sippy sippy-daemon
verify: lint
builddir:
mkdir -p sippy-ng/build
touch sippy-ng/build/index.js
frontend:
cd sippy-ng; npm run build
sippy: builddir
go build -mod=vendor ./cmd/sippy/...
sippy-daemon: builddir
go build -mod=vendor ./cmd/sippy-daemon/...
test: builddir npm
ifeq ($(ARTIFACT_DIR),)
@echo "ARTIFACT_DIR is not defined. Using default JUnit file location."
gotestsum --junitfile ./junit.xml ./pkg/...
else
@echo "ARTIFACT_DIR is defined. Using $(ARTIFACT_DIR)/junit.xml."
gotestsum --junitfile $(ARTIFACT_DIR)/junit.xml ./pkg/...
endif
LANG=en_US.utf-8 LC_ALL=en_US.utf-8 cd sippy-ng; CI=true npm test -- --coverage --passWithNoTests
lint: builddir npm
./hack/go-lint.sh run ./...
cd sippy-ng; npx eslint .
# See https://github.com/facebook/create-react-app/issues/11174 about
# why we only audit production deps:
cd sippy-ng; npm audit --production
npm:
# For debugging
npm --version
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
cd sippy-ng; npm install --no-audit
clean:
rm -f sippy
rm -f sippy-daemon
rm -rf sippy-ng/build
rm -rf sippy-ng/node_modules
e2e:
./scripts/e2e.sh
images:
$(DOCKER) build .