Skip to content

Commit

Permalink
added writing of local.xml with environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
berndb committed Jun 24, 2013
1 parent 9a62922 commit 754163d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,64 @@ cd $BUILD_DIR
# move app things to www
mkdir -p $CACHE_DIR/www
mv * $CACHE_DIR/www

# repo web/ dir is web root
mkdir www
mv $CACHE_DIR/www/web/* www/

# remove any non web/ files that might be left
rm -rf $CACHE_DIR/*

#copy .htaccess from template
cp www/_.htaccess www/.htaccess

rm ./local.xml

# write local.xml
cat >>www/app/etc/local.xml <<EOF
<?xml version="1.0"?>
<config>
<global>
<install>
<date><![CDATA[Fri, 24 Aug 2012 09:51:00 +0000]]></date>
</install>
<crypt>
<key><![CDATA[$CRYPTO_KEY]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[$DB_HOST]]></host>
<username><![CDATA[$DB_USERNAME]]></username>
<password><![CDATA[$DB_PASSWORD]]></password>
<dbname><![CDATA[$DB_NAME]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
</config>
EOF


# keep Procfile
if [ -f www/Procfile ]; then
mv www/Procfile .
Expand Down

0 comments on commit 754163d

Please sign in to comment.