forked from dmwm/deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
104 lines (94 loc) · 3.01 KB
/
deploy
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
# vim: set ft=sh sw=2 ts=8 et :
deploy_dmwmmon_deps()
{
deploy $stage backend
}
deploy_dmwmmon_prep()
{
mkproj sessions cache/dmwmmon-datasvc
}
deploy_dmwmmon_sw()
{
deploy_pkg -a dmwmmon/DBParam comp cms+DMWMMON-datasvc
(set -e
for app in DMWMMON-datasvc; do
. $root/$cfgversion/apps.$glabel/$app/etc/profile.d/init.sh
done
perl -p -i -e "
s|\@ROOT\@|$root/|g; \
s|\@WEB_VERSION\@|$DMWMMON_WEB_VERSION|g; \
s|\@DATASVC_VERSION\@|$DMWMMON_DATASVC_VERSION|g;"\
$root/$cfgversion/config/$project/{app-*.conf,*.xml}
)
[ $? = 0 ]
}
deploy_dmwmmon_post()
{
case $host in
vocms013[89] | vocms014[0123] | vocms0307 | vocms0318 )
disable
opts="" ;;
* )
enable
opts="-DDMWMMON_DATASVC -DDMWMMON_WEB" ;;
esac
rm -fr $PWD/{htdocs,etc}
(set -e
for app in DMWMMON-datasvc; do
. $root/current/apps/$app/etc/profile.d/init.sh
done
export YUI_ROOT
mkserver \
-r $PWD \
-l $project_logs \
-a $APACHE2_ROOT \
-o "$opts" \
-p $project_config/httpd-mpm.conf \
-c $project_config/httpd-dmwmmon.conf \
-d $DMWMMON_WEB_ROOT/Documentation \
-d $DMWMMON_DATASVC_ROOT/PhEDExWeb \
-e "$APACHE_SETUP_ROOT/etc/env.d/*.sh" \
-e "$DMWMMON_WEB_ROOT/etc/env.d/*.sh" \
-e "$DMWMMON_DATASVC_ROOT/etc/env.d/*.sh" \
-x "$project_config/app-*.conf" \
-m perl_module:$MOD_PERL2_ROOT/modules/mod_perl.so \
-m cache_module:$APACHE2_ROOT/modules/mod_cache.so \
-m disk_cache_module:$APACHE2_ROOT/modules/mod_disk_cache.so)
[ $? = 0 ]
setgroup -R ugo+r,go-w _config $PWD/{*.conf,etc,htdocs}
setgroup ug+rw,o-w _dmwmmon $PWD/var
(mkcrontab; sysboot
cmd="$project_config/trim-cache $PWD/cache/dmwmmon-datasvc 1G"
$nogroups || cmd="sudo -H -u _dmwmmon bashs -c '$cmd'"
[ ! -f $root/enabled/$project ] || echo "30 1-23/3 * * * $cmd") | crontab -
if $nogroups; then
rm -fr cache/dmwmmon-datasvc/*
else
sudo -H -u _dmwmmon bashs -lc "rm -fr cache/dmwmmon-datasvc/*"
fi
}
deploy_dmwmmon_auth()
{
case $1 in
*/DBParam )
cat <<-EOF
Section Prod/Writer
Interface Oracle
Database cms_dmwm_mon__IN_DEV_VM__
AuthDBUsername cms_dmwm_mon_w__IN_DEV_VM__
AuthDBPassword __FILL_ME_IN__
ConnectionLife 86400
LogConnection off
LogSQL off
Section Prod/Reader
Interface Oracle
Database cms_dmwm_mon__IN_DEV_VM__
AuthDBUsername cms_dmwm_mon_r__IN_DEV_VM__
AuthDBPassword __FILL_ME_IN__
ConnectionLife 86400
LogConnection off
LogSQL off
EOF
;;
esac
}