Skip to content

Commit

Permalink
combine setup apache / nginx tasks and set up the server based on a p…
Browse files Browse the repository at this point in the history
…roperty
  • Loading branch information
Michael O'Connell committed Sep 19, 2013
1 parent e1a3b7a commit b874b70
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
7 changes: 2 additions & 5 deletions phing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ This build file does some initialization and contains the targets which are actu
<property name="magento.archive.file" value="${magento.archive.dir}/${project.magento.edition}-${project.magento.version}.${magento.archive.extension}"/>

<!-- Development targets -->
<target name="setup_apache">
<phing buildfile="${development}" target="setup-apache" haltonfailure="true"/>
</target>
<target name="setup_nginx">
<phing buildfile="${development}" target="setup-nginx" haltonfailure="true"/>
<target name="setup_project">
<phing buildfile="${development}" target="setup-project" haltonfailure="true"/>
</target>
<target name="rebuild">
<phing buildfile="${development}" target="reset" haltonfailure="true"/>
Expand Down
1 change: 1 addition & 0 deletions phing/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
magento.archive.dir=${workspace}/../magento_archives
magento.archive.extension=tar.gz
backup.dir=${workspace}/../backups
setup.webserver=apache
project.libs.remote[email protected]:magento_tools.2.git
deploy.environments=develop,alpha,beta,live
deploy.environments.default=develop
Expand Down
17 changes: 16 additions & 1 deletion phing/development.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,22 @@
<exec dir="${project.magedir}" command="n98-magerun.phar cache:flush" checkreturn="true" logoutput="true"/>
</target>

<!-- Sets up hosts file and apache config can only be run as root -->
<!-- Sets up hosts file and apache/nginx config can only be run as root -->
<target name="setup-project">
<if>
<and>
<isset property="setup.webserver"/>
<equals arg1="${setup.webserver}" arg2="nginx"/>
</and>
<then>
<phingcall target="setup-nginx"/>
</then>
<else>
<phingcall target="setup-apache"/>
</else>
</if>
</target>

<target name="setup-apache">
<taskdef name="domains" classname="DomainsTask"/>
<taskdef name="apache-config" classname="ApacheConfigTask"/>
Expand Down

0 comments on commit b874b70

Please sign in to comment.