-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install
executable file
·120 lines (102 loc) · 3.89 KB
/
Install
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
#!/bin/sh
# This install script creates the appropriate css.element, *.css, and *.js
# files necessary for the template. The install concatenates and minifies
# the appropriate js and css files. These files are written to the filenames
# designated by the TEMPLATE_CSS_FILE, TEMPLATE_JS_FILE, HOMEPAGE_CSS_FILE,
# and HOMEPAGE_JS_FILE parameters set in GlobalConfig. There is a command
# line option to perform a 'dev' install, i.e. Install dev. This option uses
# does not perform concatenation of the css files and does not minify the css
# or js files. This is intended for developers to use so they can see their
# css changes requiring an Install.
# bring in options from MGICONFIG
if [ -z "${MGICONFIG}" ]; then
MGICONFIG=/usr/local/mgi/live/mgiconfig
fi
. ${MGICONFIG}/master.config.sh
echo "Configuring for python at: $PYTHON"
if [ -h ./python ]; then
rm ./python
fi
ln -s $PYTHON python
# generate and source GlobalConfig sh file
if [ -z "$LIB_PY_MISC" ]
then
LIB_PY_MISC=/usr/local/mgi/live/lib/python
export LIB_PY_MISC
fi
if [ "`uname -n | cut -d'.' -f1`" == "bhmgipub01lt" ]
then
rm -rf images.rcd webshare.config
cp images.rcd.defaults images.rcd
cp webshare.config.defaults webshare.config
cd config
rm -rf GlobalConfig
ln -s GlobalConfig.test GlobalConfig
cd ..
elif [ "`uname -n | cut -d'.' -f1`" == "bhmgipub01lp" ]
then
rm -rf images.rcd webshare.config
cp images.rcd.defaults images.rcd
cp webshare.config.defaults.pub webshare.config
cd config
rm -rf GlobalConfig GlobalConfig.old
ACTIVE_PUB=`/usr/local/mgi/jenkins_admin/bin/getActivePublic`
export ACTIVE_PUB
echo 'ACTIVE_PUB', $ACTIVE_PUB
if [ "${ACTIVE_PUB}" == "pub1" ]
then
echo 'if found', $ACTIVE_PUB
ln -s GlobalConfig.pub1 GlobalConfig
ln -s GlobalConfig.pub2 GlobalConfig.old
else
echo 'else', $ACTIVE_PUB
ln -s GlobalConfig.pub2 GlobalConfig
ln -s GlobalConfig.pub1 GlobalConfig.old
fi
cd ..
fi
$LIB_PY_MISC/Configuration.py config/GlobalConfig sh > .Configuration.sh
. .Configuration.sh
rm .Configuration.sh
# clean out old minified js files
echo "Clean up js files"
rm -f ./js/mgi.js
rm -f ./js/$TEMPLATE_JS_FILE
rm -f ./js/$MGIHOME_JS_FILE
# clean out old minified css files
echo "Clean up css files"
rm -f ./css/$MGIHOME_CSS_FILE
# generate mgi.js file
echo "Generate js files"
catReplace.py ./js/mgi.txt > ./js/mgi.js
# cleanup element files
echo "Cleanup css element"
rm -f template/elements/css.element
if [ $# -gt 0 ]
then
# test dev build & write dev css and js element files, otherwise
# write default css and js element files and cat and minify them
if [ $1 = "dev" ]
then
echo "Copy dev css element"
cp template/elements/cssDev.element template/elements/css.element
# concatenate js files
cat /css/yui_overrides.css ./css/mgi.css ./css/template.css ./css/fewi.css > ./css/$TEMPLATE_CSS_FILE
cat ./css/ajaxtabs.css ./css/homepages.css > ./css/$MGIHOME_CSS_FILE
cat ./js/overlibHomepage.js ./js/overlib*.js ./js/mgi.js > ./js/$TEMPLATE_JS_FILE
cp ./js/ajaxtabs.js ./js/$MGIHOME_JS_FILE
fi
else
echo "Copy default css element"
cp template/elements/cssDefault.element template/elements/css.element
# clean out old minified css files
echo "Clean up css files"
rm -f ./css/$TEMPLATE_CSS_FILE
# minify css files
echo "Generate css files"
cat ./css/yui_overrides.css ./css/mgi.css ./css/template.css ./css/fewi.css | java -jar yuicompressor-2.4.2.jar --type css > ./css/$TEMPLATE_CSS_FILE
cat ./css/ajaxtabs.css ./css/homepages.css | java -jar yuicompressor-2.4.2.jar --type css > ./css/$MGIHOME_CSS_FILE
# concatenate and minify js files
cat ./js/overlibHomepage.js ./js/overlib_*.js ./js/mgi.js | java -jar yuicompressor-2.4.2.jar --type js > ./js/$TEMPLATE_JS_FILE
cat ./js/ajaxtabs.js | java -jar yuicompressor-2.4.2.jar --type js > ./js/$MGIHOME_JS_FILE
fi