Skip to content

Instantly share code, notes, and snippets.

@JanMikes
Last active July 12, 2017 23:05
Show Gist options
  • Save JanMikes/f467cae70827c98e4a4a5073c3d5766c to your computer and use it in GitHub Desktop.
Save JanMikes/f467cae70827c98e4a4a5073c3d5766c to your computer and use it in GitHub Desktop.
First Phing build script
<?xml version="1.0" encoding="UTF-8"?>
<project name="OdbavTo" default="production" basedir=".">
<property environment="env" />
<property name="configFile" value="app/config/config.testttt.neon" />
<target name="production" description="Creates local config file">
<available file="${configFile}" property="configExists" />
<echo msg="Config file: ${configFile}" />
<echo msg="Config exists: ${configExists}" />
<if>
<not>
<isset property="configExists" />
</not>
<then>
<echo msg="Creating ${configFile} config file" />
<touch file="${configFile}" />
<!-- PARAMETERS SECTION -->
<echo file="${configFile}" msg="parameters:${line.separator}" />
<!-- RabbitMQ -->
<append destFile="${configFile}" text=" rabbit:${line.separator}" />
<append destFile="${configFile}" text=" host: ${env.RABBIT_HOST}${line.separator}" />
<append destFile="${configFile}" text=" port: ${env.RABBIT_PORT}${line.separator}" />
<append destFile="${configFile}" text=" user: ${env.RABBIT_USER}${line.separator}" />
<append destFile="${configFile}" text=" password: ${env.RABBIT_PASSWORD}${line.separator}" />
<append destFile="${configFile}" text=" vhost: ${env.RABBIT_VHOST}${line.separator}" />
<!-- Mailgun -->
<append destFile="${configFile}" text=" mailgun:${line.separator}" />
<append destFile="${configFile}" text=" apiKey: ${env.MAILGUN_API_KEY}${line.separator}" />
<append destFile="${configFile}" text=" domain: ${env.MAILGUN_DOMAIN}${line.separator}" />
<!-- Mongo -->
<append destFile="${configFile}" text=" mongo:${line.separator}" />
<append destFile="${configFile}" text=" host: ${env.MONGO_HOST}${line.separator}" />
<append destFile="${configFile}" text=" dbname: ${env.MONGO_DBNAME}${line.separator}" />
<!-- GPWebPay -->
<append destFile="${configFile}" text=" GPWebPay:${line.separator}" />
<append destFile="${configFile}" text=" webpayUrl: ${env.GPWEBPAY_URL}${line.separator}" />
<append destFile="${configFile}" text=" publicKey: ${env.GPWEBPAY_PUBLIC_KEY}${line.separator}" />
<!-- Sentry -->
<append destFile="${configFile}" text=" sentry:${line.separator}" />
<append destFile="${configFile}" text=" host: ${env.SENTRY_HOST}${line.separator}" />
<!-- ExpresDoklad -->
<append destFile="${configFile}" text=" expresDoklad:${line.separator}" />
<append destFile="${configFile}" text=" endpoint: ${env.EXPRESDOKLAD_ENDPOINTS_BASEURI}${line.separator}" />
<append destFile="${configFile}" text=" clientId: ${env.EXPRESDOKLAD_CLIENT_ID}${line.separator}" />
<append destFile="${configFile}" text=" secret: ${env.EXPRESDOKLAD_SECRET}${line.separator}" />
<append destFile="${configFile}" text=" user: ${env.EXPRESDOKLAD_USER}${line.separator}" />
<append destFile="${configFile}" text=" password: ${env.EXPRESDOKLAD_PASSWORD}${line.separator}" />
<append destFile="${configFile}" text=" companyId: ${env.EXPRESDOKLAD_COMPANY_ID}${line.separator}" />
<!-- Doctrine -->
<append destFile="${configFile}" text="doctrine:${line.separator}" />
<append destFile="${configFile}" text=" host: ${env.MYSQL_HOST}${line.separator}" />
<append destFile="${configFile}" text=" port: ${env.MYSQL_PORT}${line.separator}" />
<append destFile="${configFile}" text=" user: ${env.MYSQL_USER}${line.separator}" />
<append destFile="${configFile}" text=" password: ${env.MYSQL_PASSWORD}${line.separator}" />
<append destFile="${configFile}" text=" dbname: ${env.MYSQL_DATABASE}${line.separator}" />
</then>
<else>
<echo msg="Config ${configFile} already exists, skipping" />
</else>
</if>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment