forked from Juniper/contrail-web-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
129 lines (110 loc) · 4.9 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
REPORTER = dot
WEBUISERVER = contrail-web-core
WEBUICLIENT = contrail-web-controller
WEBUITHIRDPARTY = contrail-webui-third-party
THIRD_PARTY='../contrail-webui-third-party'
$(WEBUISERVER):
if [ ! -d ../$(WEBUISERVER) ]; then git clone [email protected]:Juniper/contrail-web-core.git ../$(WEBUISERVER); else cd ../$(WEBUISERVER) && touch testFile && git stash; git pull --rebase; git stash pop; rm testFile; fi
$(WEBUICLIENT):
if [ ! -d ../$(WEBUICLIENT) ]; then git clone [email protected]:Juniper/contrail-web-controller.git ../$(WEBUICLIENT); else cd ../$(WEBUICLIENT) && touch testFile && git stash; git pull --rebase; git stash pop; rm testFile; fi
$(WEBUITHIRDPARTY):
if [ ! -d ../$(WEBUITHIRDPARTY) ]; then git clone [email protected]:Juniper/contrail-webui-third-party.git ../$(WEBUITHIRDPARTY); else cd ../$(WEBUITHIRDPARTY) && touch testFile && git stash; git pull --rebase; git stash pop; rm testFile; fi
repos: $(WEBUISERVER) $(WEBUICLIENT) $(WEBUITHIRDPARTY)
fetch-pkgs-prod:
python ../contrail-webui-third-party/fetch_packages.py -f ../contrail-webui-third-party/packages.xml
make clean
rm -rf node_modules
mkdir -p node_modules
cp -rf $(THIRD_PARTY)/node_modules/* node_modules/.
fetch-pkgs-dev:
make clean
rm -rf node_modules
mkdir -p node_modules
python ../contrail-webui-third-party/fetch_packages.py -f ../contrail-webui-third-party/packages.xml
python ../contrail-webui-third-party/fetch_packages.py -f ../contrail-webui-third-party/packages_dev.xml
cp -rf $(THIRD_PARTY)/node_modules/* node_modules/.
package:
make clean
make fetch-pkgs-prod
rm -f webroot/html/dashboard.html
rm -f webroot/html/login.html
rm -f webroot/html/login-error.html
cp -a webroot/html/dashboard.tmpl webroot/html/dashboard.html
cp -a webroot/html/login.tmpl webroot/html/login.html
cp -a webroot/html/login-error.tmpl webroot/html/login-error.html
./generate-files.sh 'prod-env' $(REPO)
./dev-install.sh
# build the minified, unified files.
./build-files.sh "prod-env" $(REPO)
./prod-dev.sh webroot/html/dashboard.html prod_env dev_env true
./prod-dev.sh webroot/html/login.html prod_env dev_env true
./prod-dev.sh webroot/html/login-error.html prod_env dev_env true
make-ln:
cp -af webroot/html/dashboard.html webroot/html/dashboard.tmpl
rm -f webroot/html/dashboard.html
ln -sf ../../webroot/html/dashboard.tmpl webroot/html/dashboard.html
cp -af webroot/html/login.html webroot/html/login.tmpl
rm -f webroot/html/login.html
ln -sf ../../webroot/html/login.tmpl webroot/html/login.html
cp -af webroot/html/login-error.html webroot/html/login-error.tmpl
rm -f webroot/html/login-error.html
ln -sf ../../webroot/html/login-error.tmpl webroot/html/login-error.html
rm -f webroot/html/login-error.html
ln -sf ../../webroot/html/login-error.tmpl webroot/html/login-error.html
dev-env:
mkdir -p webroot/html
ln -sf ../../webroot/html/dashboard.tmpl webroot/html/dashboard.html
ln -sf ../../webroot/html/login.tmpl webroot/html/login.html
ln -sf ../../webroot/html/login-error.tmpl webroot/html/login-error.html
./generate-files.sh "dev-env" $(REPO)
./dev-install.sh
./prod-dev.sh webroot/html/dashboard.html dev_env prod_env true
./prod-dev.sh webroot/html/login.html dev_env prod_env true
./prod-dev.sh webroot/html/login-error.html dev_env prod_env true
make make-ln
# For test files, we will setting the env file with current environment.
./unit-test.sh set-env "dev"
test-env:
./unit-test.sh init $(REPO)
prod-env:
mkdir -p webroot/html
ln -sf ../../webroot/html/dashboard.tmpl webroot/html/dashboard.html
ln -sf ../../webroot/html/login.tmpl webroot/html/login.html
ln -sf ../../webroot/html/login-error.tmpl webroot/html/login-error.html
./generate-files.sh "dev-env" $(REPO)
./dev-install.sh
# build the minified, unified files.
./build-files.sh "prod-env" $(REPO)
./prod-dev.sh webroot/html/dashboard.html prod_env dev_env true
./prod-dev.sh webroot/html/login.html prod_env dev_env true
./prod-dev.sh webroot/html/login-error.html prod_env dev_env true
make make-ln
# For test files, we will setting the env file with current environment.
./unit-test.sh set-env "prod"
clear-cache-dev:
./prod-dev.sh webroot/html/dashboard.html dev_env prod_env false
./prod-dev.sh webroot/html/login.html dev_env prod_env false
./prod-dev.sh webroot/html/login-error.html dev_env prod_env false
make make-ln
clear-cache-prod:
./prod-dev.sh webroot/html/dashboard.html prod_env dev_env false
./prod-dev.sh webroot/html/login.html prod_env dev_env false
./prod-dev.sh webroot/html/login-error.html prod_env dev_env false
make make-ln
test-node:
./unit-test.sh node
test-ui:
./unit-test.sh ui
test:
make test-node
make test-ui
clean:
rm -f src/serverroot/jobs/core/jobsCb.api.js
rm -f src/serverroot/web/core/feature.list.js
rm -f src/serverroot/web/routes/url.routes.js
rm -rf node_modules
rm -rf webroot/assets
.PHONY: package dev-env prod-env test clean