#!/bin/bash # This script reads the constants table in the database and generates # an XML from which all other source files can import. # Fetch the most recent values for the constants for the appropriate server. # The function calls get_deployment_profile() to determine the type of # server environment (e.g., production or development). sudo su - postgres -c "psql recipe -t -A -q -c 'select recipe.generate_configuration_xml();' -o /tmp/constants.xml" cp /tmp/constants.xml . # Transform the constants into a programming language variable. xsltproc --stringparam language javascript generate.xsl constants.xml > ../common/js/rz.constants.js xsltproc --stringparam language xsl generate.xsl constants.xml > ../common/xsl/constants.xsl xsltproc --stringparam language php generate.xsl constants.xml > ../common/php/constants.php # Don't leave old files lying around (not included in repository). rm constants.xml