Skip to content

Instantly share code, notes, and snippets.

@kbariotis
Created July 17, 2014 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbariotis/8bce64d27aebc45fc738 to your computer and use it in GitHub Desktop.
Save kbariotis/8bce64d27aebc45fc738 to your computer and use it in GitHub Desktop.
Phing script to deploy clean Magento 1.9 setup (not finished)
<?xml version="1.0" encoding="UTF-8"?>
<project name="mageploy" default="prepare">
<target name="prepare">
<echo msg="Making directory ./tmp" />
<mkdir dir="./tmp" />
<if>
<available file="./tmp/magento-1.9.0.1.zip" property="downloaded" />
<else>
<echo msg="Downloading latest Magento" />
<httpget url="http://www.magentocommerce.com/downloads/assets/1.9.0.1/magento-1.9.0.1.zip"
dir="./tmp" followRedirects="true" />
</else>
</if>
<if>
<available file="./tmp/magento" type="dir" property="downloaded" />
<else>
<echo msg="Unzipping" />
<unzip file="./tmp/magento-1.9.0.1.zip" todir="./tmp" />
</else>
</if>
<if>
<available file="./tmp/magento" type="dir" property="downloaded" />
<then>
<echo msg="Moving to root" />
<copy todir="./" >
<fileset dir="./tmp/magento">
<include name="**/*.*" />
</fileset>
</copy>
</then>
</if>
</target>
<target name="install">
<input propertyname="host" message="baseurl" />
<input propertyname="db_host" message="db_host" />
<input propertyname="db_user" message="db_user" />
<input propertyname="db_pass" message="db_pass" />
<input propertyname="db_name" message="db_name" />
<echo message="${host}"/>
<echo message="${db_host}"/>
<echo message="${db_user}"/>
<echo message="${db_pass}"/>
<echo message="${db_name}"/>
<exec command='php install.php --license_agreement_accepted "yes" --locale "en_US" --timezone "Europe/Athens" --default_currency "EUR" --db_host "${db_host}" --db_name "${db_name}" --db_user "${db_user}" --db_pass "${db_pass}" --session_save "db" --admin_frontname "admin" --url "${host}" --use_rewrites "yes" --use_secure "yes" --secure_base_url "${host}" --use_secure_admin "no" --admin_firstname "John" --admin_lastname "Smith" --admin_email "john.smith@widgets.com" --admin_username "admin" --admin_password "mag3nto" ' escape="false" passthru="true" />
</target>
<target name="clone">
<mkdir dir="./tmp/repo" />
<gitclone repository="" targetPath="./tmp/repo" />
<copy todir="./" overwrite="true">
<fileset dir="./tmp/repo">
<include name="**/*.*" />
</fileset>
</copy>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment