-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
94 lines (71 loc) · 2.19 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
92
93
94
NEXUS="https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org"
PROJECT_DIR=$(shell pwd)
APP_MODULES_DIR=$(shell realpath ${PROJECT_DIR}/packages/app/node_modules)
ifndef NEXUS_REPO
NEXUS_REPO=true
endif
ifndef NEXUS_CERT_PATH
NEXUS_CERT_PATH=""
endif
app:
@./packages/app/.bin/check-assumptions.sh
@./packages/dev/.bin/dev-server.sh
build:
./packages/app/.bin/check-assumptions.sh
@cd ./packages/app && .bin/build.sh ${PROJECT_DIR}
# prepare tarball with node modules that are necessary to build the application
modules-pack:
@cd ./packages/app \
&& .bin/modules-prepare.sh ${APP_MODULES_DIR} \
&& .bin/modules-patch.sh ${APP_MODULES_DIR} \
&& .bin/modules-tar.sh ${APP_MODULES_DIR} ${PROJECT_DIR} \
&& .bin/modules-restore.sh ${APP_MODULES_DIR} \
@ls -l ./*.tar.xz
modules-prepare:
@cd ./packages/app && echo y | .bin/modules-prepare.sh ${APP_MODULES_DIR}
modules-patch:
@cd ./packages/app && .bin/modules-patch.sh ${APP_MODULES_DIR}
dev:
@cd ./packages/dev-backend && .bin/dev-backend.sh
test:
@cd ./packages/test && .bin/run-dev-tests.sh
test-modules-prepare:
@cd ./packages/test && npx npm ci
@cd ./packages/dev-backend && npx npm ci
ci-cluster-test:
@cd ./packages/test && .bin/run-jest.sh -s -p src/test/realBackend
clean:
rm -rf build
rm pcs-web-ui-node-modules-*.tar.xz
init_nexus:
ifeq ($(NEXUS_CERT_PATH),"")
echo "Specify path of nexus certificate, please"
else
@.bin/init_nexus.sh ./packages ${NEXUS} ${NEXUS_CERT_PATH}
endif
init:
ifeq ($(NEXUS_REPO),true)
@echo "Use \`make init NEXUS_REPO=false\` not to use the Nexus repo."
@.bin/init.sh ${NEXUS}
else
@echo "If you will need reinit with the Nexus repo run \`make init\`"
@.bin/init.sh
endif
check_sources:
@.bin/check-no-nexus.sh
lint:
@.bin/lint.sh ./packages
fmt:
npx prettier "packages/app/src/" --write
packages/app/node_modules/.bin/eslint --fix --ext .js,.ts,.tsx packages/app/src/
_install:
ifndef PCSD_DIR
$(error PCSD_DIR has to be specified)
endif
@if test ! -d build; then echo "Run 'make build' first"; false; fi
mkdir -p $(PCSD_DIR)/public/ui
cp -r build/* $(PCSD_DIR)/public/ui
install: build _install
npm_install:
@.bin/npm_install.sh ./packages
.PHONY: test build