Skip to content

Instantly share code, notes, and snippets.

@zviryatko
Created July 11, 2018 16:25
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 zviryatko/ae09d14f423bab59344755668bf736b5 to your computer and use it in GitHub Desktop.
Save zviryatko/ae09d14f423bab59344755668bf736b5 to your computer and use it in GitHub Desktop.
Phing tasks for local drupal development
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Phing configuration file
-
- Installation:
- `curl -OLsS https://www.phing.info/get/phing-latest.phar`
- `chmod +x phing-latest.phar`
- `mv phing-latest.phar /usr/local/bin/phing-latest`
-
- Configuration:
- Copy file to project root with name `build.xml`
-
- Run:
- `phing` - will run default target "update"
- or
- `phing sync` - will update db and files
- or
- `phing udpate html` - will update the code and rebuild css/js files
-->
<project name="Update" default="update" basedir="." description="a demo project">
<target name="full-update" description="Make full update.">
<phingcall target="sync" />
<phingcall target="update" />
<phingcall target="html" />
<exec command="./bin/drush browse" />
</target>
<target name="update" description="Update the code, db and features.">
<exec command="git pull" logoutput="true" />
<exec command="composer install" logoutput="true" />
<exec command="./bin/drush updb --entity-updates -y" logoutput="true" />
<exec command="./bin/drush -y cim" logoutput="true" />
<exec command="./bin/drush -y csim stage" logoutput="true" />
<exec command="./bin/drush cr" logoutput="true" />
<echo message="Code update complete!" />
</target>
<target name="sync" description="Download fresh db and files.">
<exec command="./bin/drush sql-sync @adagio.stage @self -y" logoutput="true" />
<exec command="./bin/drush rsync @adagio.stage:%files @self:sites/default --exclude-paths=css:js:styles:php -y" logoutput="true" />
<echo message="Download complete!" />
</target>
<target name="html" description="Build slices">
<exec command="npm install" dir="html" logoutput="true" />
<exec command="npm run build" dir="html" logoutput="true" />
<echo message="Slices updated" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment