-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_compile.sh
56 lines (39 loc) · 1.13 KB
/
docker_compile.sh
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
#!/bin/bash
less=/usr/local/lib/node_modules/less/bin/lessc
miniJs=/usr/local/lib/node_modules/uglify-es/bin/uglifyjs
TS=$(date +"%Y%m%d%H%M%S")
echo -n "Compiling APIDOC ..."
apidoc -i application/ -o public/apidoc/
cd public/css
rm admin.*.css
rm compiled.*.css
echo -n "CSS: compiled.$TS.css ... "
$less -ru coursesuite.less compiled.$TS.css
echo ""
$less -ru admin.less admin.$TS.css
echo ""
cd ../js
rm admin.201*.js
rm main.201*.js
echo -n "JS: admin.$TS.js ... "
$miniJs --keep-fnames admin.js --output admin.$TS.js
echo ""
echo -n "JS: main.$TS.js ... "
$miniJs --keep-fnames main.js --output main.$TS.js
echo ""
cd ../../application/core
echo "<?php" > Variables.php
echo "DEFINE('APP_CSS', '/css/compiled.$TS.css');" >> Variables.php
echo "DEFINE('APP_JS', '/js/main.$TS.js');" >> Variables.php
echo "DEFINE('ADMIN_CSS', '/css/admin.$TS.css');" >> Variables.php
echo "DEFINE('ADMIN_JS', '/js/admin.$TS.js');" >> Variables.php
echo "?>" >> Variables.php
cd ../..
rm -r -f deploy
mkdir deploy
cp application deploy
cp public deploy
cp precompiled deploy
cp vendor deploy
cp websockets deploy
ls | grep -v 'deploy' | parallel rm