-
Notifications
You must be signed in to change notification settings - Fork 0
/
siwapp-app.sh
62 lines (50 loc) · 1.62 KB
/
siwapp-app.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
57
58
59
60
61
62
#!/bin/bash -x
curl -o /tmp/provisioningVars.sh ${FILE_SERVER}/pod_${POD}_variables.sh
. /tmp/provisioningVars.sh
echo "Starting app install script"
yum -y update
yum -y install git httpd php php-mysql php-xml php-mbstring
yum clean all
git clone https://github.com/siwapp/siwapp-sf1.git /var/www/html/
mkdir /var/www/html/cache
chmod 777 /var/www/html/cache
chmod 777 /var/www/html/web/config.php
chmod 777 /var/www/html/config/databases.yml
mkdir /var/www/html/web/uploads
chmod 777 /var/www/html/web/uploads
chown -R apache:apache /var/www/html/
sed -i -e '57,63d' /var/www/html/web/pre_installer_code.php
sed -i "s/80/${APP_PORT}/" /etc/httpd/conf/httpd.conf
sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/httpd/conf/httpd.conf
sed -i "21s%.*%${HOSTNAME}%g" /var/www/html/apps/siwapp/templates/layout.php
su -c "echo $'<Directory /var/www/html/web>
Options FollowSymLinks
AllowOverride All
</Directory>
<VirtualHost *:${APP_PORT}>
DocumentRoot /var/www/html/web
RewriteEngine On
</VirtualHost>'\
>> /etc/httpd/conf/httpd.conf"
su -c "cat << EOF > /var/www/html/config/databases.yml
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=${HAPROXY_DB_IP};dbname=siwapp'
username: '${GALERA_DB_USER}'
password: '${GALERA_DB_USER_PWD}'
test:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=${HAPROXY_DB_IP};dbname=siwapp_test'
username: '${GALERA_DB_USER}'
password: '${GALERA_DB_USER_PWD}'
EOF
"
sed -i.bak "s#false#true#g" /var/www/html/web/config.php
echo "Restarting http services"
systemctl enable httpd
systemctl start httpd
echo "App install script complete"