-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
124 lines (112 loc) · 3.51 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
HR="=========================================="
SHELL=bash
export PYTHON=python2
all: | build publish
dev: | devbuild devpub
devbuild:
@echo ${HR}
@echo "Syncing NPM build deps"
@echo ${HR}
npm install uglify-js@1 recess bower coffee-script
@echo ${HR}
@echo "Syncing NPM runtime deps"
@echo ${HR}
npm update
@echo ${HR}
@echo "Syncing local Bower deps"
@echo ${HR}
node_modules/bower/bin/bower update
@echo ${HR}
@echo "Building Bootstrap"
@echo ${HR}
cd components/bootstrap; npm install; $(MAKE) bootstrap
@echo ${HR}
@echo "Building jQuery"
@echo ${HR}
node_modules/uglify-js/bin/uglifyjs -nc components/jquery/jquery.js > components/jquery/jquery.min.js
@echo ${HR}
@echo "Building jQuery Validation"
@echo ${HR}
node_modules/uglify-js/bin/uglifyjs -nc components/jquery.validation/jquery.validate.js > components/jquery.validation/jquery-validate.min.js
@echo ${HR}
@echo "Building Knockout"
@echo ${HR}
cd components/knockout/build; ./build-linux
node_modules/uglify-js/bin/uglifyjs -nc components/knockout/build/output/knockout-latest.js > components/knockout/build/output/knockout.min.js
@echo ${HR}
@echo "Building Knockout-Mapping"
@echo ${HR}
cd components/knockout-mapping/build; bash ./build-linux
node_modules/uglify-js/bin/uglifyjs -nc components/knockout-mapping/build/output/knockout.mapping-latest.js > components/knockout-mapping/build/output/knockout-mapping.min.js
devpub: | clean_pub
@echo ${HR}
@echo "Preparing to publish"
@echo ${HR}
mkdir -p public/{js,css,img}
@echo ${HR}
@echo "Processing coffeescripts"
@echo ${HR}
node_modules/coffee-script/bin/coffee -co public/js source/coffee
@echo ${HR}
@echo "Publishing Bower components"
@echo ${HR}
-cp -f ${PWD}/components/bootstrap/bootstrap/js/*.min.js public/js
-cp -f ${PWD}/components/bootstrap/bootstrap/css/*.min.css public/css
-cp -f ${PWD}/components/bootstrap/bootstrap/img/* public/img
-cp -f ${PWD}/components/knockout/build/output/knockout.min.js public/js
-cp -f ${PWD}/components/knockout-mapping/build/output/knockout-mapping.min.js public/js
-cp -f ${PWD}/components/knockout-sortable/build/knockout-sortable.min.js public/js
-cp -f ${PWD}/components/jquery/jquery.min.js public/js
-cp -f ${PWD}/components/jquery-ui/ui/minified/jquery-ui.custom.min.js public/js/jquery-ui.min.js
-cp -f ${PWD}/components/jquery.validation/jquery-validate.min.js public/js
@echo ${HR}
@echo "Publishing Dashboard components"
@echo ${HR}
-cp -rn ${PWD}/source/ public
build:
@echo ${HR}
@echo "Syncing NPM build deps"
@echo ${HR}
npm install coffee-script jade
@echo ${HR}
@echo "Syncing NPM runtime deps"
@echo ${HR}
npm update
publish: | clean_pub
@echo ${HR}
@echo "Preparing to deploy"
@echo ${HR}
mkdir -p public/{js,css,img}
@echo ${HR}
@echo "Deploying Coffeescripts"
@echo ${HR}
node_modules/coffee-script/bin/coffee -co public/js source/coffee
@echo ${HR}
@echo "Deploying Jade templates"
@echo ${HR}
node_modules/jade/bin/jade views/index.jade --out public
@echo ${HR}
@echo "Deploying Dashboard components"
@echo ${HR}
-cp -fr source/* public
@echo ${HR}
@echo "Scaffolding config file"
@echo ${HR}
-mkdir public/api
-cp config.json.sample public/api/config
deploy:
HOME=${PWD} $(MAKE)
cert:
-rm -f *.pem
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem
-rm -f csr.pem
clean: clean_com clean_node clean_pub
-rm -f *.log
clean_com:
-rm -rf components
clean_node:
-rm -rf node_modules
clean_pub:
-rm -rf public