/
Makefile
91 lines (73 loc) · 1.88 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
OSFLAG += -D IA32
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OSFLAG += -D LINUX
endif
ifeq ($(UNAME_S),Darwin)
OSFLAG += -D OSX
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
OSFLAG += -D AMD64
endif
ifneq ($(filter %86,$(UNAME_P)),)
OSFLAG += -D IA32
endif
ifneq ($(filter arm%,$(UNAME_P)),)
OSFLAG += -D ARM
endif
endif
echoos:
@echo $(OSFLAG)
# TODO: setup hadolint based on the OS of the development machine this is being run on
# this can be done with the OSFLAG above which already detects the current OS. Currently, this only setups up
# hadolint on Linux
setup-hadolint:
# if running on Linux
wget -O ./bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64
chmod +x ./bin/hadolint
setup-trivy:
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b ./bin v0.16.0
install:
yarn install
start:
yarn start
test:
yarn test
test-coverage:
yarn test:coverage
scan-frontend:
yarn audit --audit-level=critical
scan-docker-image:
@echo "Scanning Docker Image: $(IMAGE)"
./bin/trivy $(IMAGE)
# See local hadolint install instructions: https://github.com/hadolint/hadolint
# This is linter for Dockerfiles
lint-docker:
./bin/hadolint Dockerfile
lint:
yarn lint
lint-fix:
yarn lint:fix
build:
yarn build
build-docker:
./scripts/docker/build_docker.sh
push-docker:
./scripts/docker/upload_docker.sh
# See https://circleci.com/docs/2.0/local-cli/#processing-a-config
validate-circleci:
circleci config validate
# See https://circleci.com/docs/2.0/local-cli/#processing-a-config
process-circleci:
circleci config process .circleci/config.yml
all: install lint lint-docker test