-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·40 lines (33 loc) · 1.84 KB
/
setup.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
#!/usr/bin/env bash
# Database configuration is overwritten by Heroku
#export PEPIS_CMS_DATABASE_HOSTNAME=db
#export PEPIS_CMS_DATABASE_USERNAME=pepiscms
#export PEPIS_CMS_DATABASE_PASSWORD=pepiscms
#export PEPIS_CMS_DATABASE_DATABASE=pepiscms
export PEPIS_CMS_DATABASE_CONFIG_TYPE=native
export PEPIS_CMS_AUTH_DRIVER=native
export PEPIS_CMS_AUTH_EMAIL=demo@example.com
export PEPIS_CMS_AUTH_PASSWORD=demodemo
export PEPIS_CMS_SITE_EMAIL=noreply@example.com
export PEPIS_CMS_SITE_NAME=Demonstration
composer update --prefer-dist piotrpolak/pepiscms && \
echo "PepisCMS updated"
cp vendor/piotrpolak/pepiscms/pepiscms/resources/config_template/template_index.php ./index.php && \
echo "index.php created" && \
sed -i -e 's/TEMPLATE_VENDOR_PATH/\.\/vendor\//g' ./index.php && \
echo "vendor path adjusted" && \
cp vendor/piotrpolak/pepiscms/pepiscms/resources/config_template/template_.htaccess ./.htaccess && \
echo ".htaccess created" && \
php index.php tools install true && \
echo "PepisCMS installed" && \
php index.php tools register_admin $PEPIS_CMS_AUTH_EMAIL $PEPIS_CMS_AUTH_PASSWORD && \
echo "Admin account created"
DEPLOY_DATE=`date '+%Y-%m-%d %H:%M:%S'`
echo "" >> application/config/_pepiscms.php && \
echo "\$config['cms_login_page_description'] = '$PEPIS_CMS_AUTH_EMAIL / $PEPIS_CMS_AUTH_PASSWORD<br><br>All changes done to this demo application are reverted every time the application is redeployed.<br>Last deployed at $DEPLOY_DATE <script>(function() {\$(\"#user_email\").val(\"demo@example.com\");\$(\"#password\").val(\"demodemo\");})();</script>';" >> application/config/_pepiscms.php && \
echo "Customized login page"
chmod 0777 -R application/cache/ && \
chmod 0777 -R application/config/ && \
chmod 0777 -R application/logs/ && \
chmod 0777 -R uploads/ && \
echo "Access rights adjusted"