Phing and drupal

2,795 views

Published on

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
2,795
On SlideShare
0
From Embeds
0
Number of Embeds
1,171
Actions
Shares
0
Downloads
7
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Phing and drupal

  1. 1. Phing and Drupal First steps to contiuous integration Vladimir Melnic vladimir.melnic@wearepropeople.com
  2. 2. PHING PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework. ➔ http://www.phing.info/trac/
  3. 3. DRUPAL Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world. ➔ https://drupal.org/
  4. 4. Requirements ✔ pear channel-discover pear.phing.info ✔ pear install phing/phing ✔ https://drupal.org/project/phingdrushtask ✔ pear install VersionControl_Git-0.4.4 ➔ http://pear.php.net/package/VersionControl_Git/download ➔ https://drupal.org/project/phingdrushtask
  5. 5. Demo ➔ git@bitbucket.org:vladimir_m/soldanesti.org_make.git ➔ cd soldanesti.org/ ➔ phing ➔ https://bitbucket.org/vladimir_m/soldanesti.org_make
  6. 6. Files: ● build.xml – main phing build file. ● contrib.make - Drush make file. ● custom.make - Drush make file. ● DrushTask.php - Phing Drush Task. ● README.md – Readme file. ● soldanesti.org – Cloned folder.
  7. 7. File::build.xml <?xml version="1.0" encoding="UTF-8" ?> <project name="soldanesti.org" default="build"> <target name="build" depends="init, drush_core, drush_contrib, drush_custom, files_directory, create_settings.php"/> … </project>
  8. 8. File::build.xml(Target[init]) <target name="init"> <taskdef name="drush" classname="DrushTask"/> <php function="dirname" returnProperty="phing.dir"> <param value="${phing.file}"/> </php> <property name="project.basedir" value="${project.basedir}"/> <property name="project.code.dir" value="${project.basedir}/${phing.project.name}"/> <property name="drupal.contrib.make.file" value="contrib.make"/> <property name="drupal.custom.make.file" value="custom.make"/> <property name="drupal.sites.dir" value="${phing.project.name}/sites/all"/> <property name="drupal.files.dir" value="${phing.project.name}/sites/default/files"/> <property name="drupal.settings.dir" value="${phing.project.name}/sites/default"/> </target>
  9. 9. File::build.xml(Target[drush_core]) <!-- Download drupal core. --> <target name="drush_core" description="Download drupal core." depends="init"> <drush command='dl drupal' assume="yes" pipe="true"> <option name="drupal-project-rename">${phing.project.name}</option> </drush> </target>
  10. 10. File::build.xml(Target[drush_contrib]) <!-- Execute drush make file and download contrib modules. --> <target name="drush_contrib" description="Download drupal contrib modules." depends="init"> <drush command="make" assume="yes" pipe="true"> <param>${drupal.contrib.make.file}</param> <option name="contrib-destination">${drupal.sites.dir}</option> <option name="no-core"/> </drush> </target>
  11. 11. File::build.xml(Target[files_directory]) <!-- Make files directory. --> <target name="files_directory" description="Create site/default/files directory." depends="init"> <mkdir dir="${drupal.files.dir}"/> <chmod file="${drupal.files.dir}" mode="0777" failonerror="true"/> </target>
  12. 12. File::build.xml(Target[create_settings.php]) <!-- Manipulate settings.php file. --> <target name="create_settings.php" description="Copy default.settings.php file to settings.php." depends="init"> <!--<echo msg="Copying default.settings.php file to settings.php..." />--> <copy file="${drupal.settings.dir}/default.settings.php" tofile="${drupal.settings.dir}/settings.php"/> <chmod file="${drupal.settings.dir}/settings.php" mode="0777" failonerror="true"/> </target>
  13. 13. Demo::consoleLog() Buildfile: /var/www/soldanesti.org/build.xml soldanesti.org > init: [php] Calling PHP function: dirname() soldanesti.org > drush_core: [drush] standard [drush] node [drush] menu … [drush] blog [drush] overlay soldanesti.org > drush_contrib: [drush] >> Project admin_menu contains 3 modules: ... [drush] >> Project devel contains 3 modules: … [drush] >> Project ctools contains 9 modules: … soldanesti.org > drush_custom: … soldanesti.org > build: BUILD FINISHED
  14. 14. Resources ➔ http://reload.github.io/phing-drupal-template/ ➔ http://www.phing.info/docs/guide/trunk/chapters/GettingStarted.html ➔ https://drupal.org/project/phingdrushtask ➔ http://google.com
  15. 15. Thank You!Thank You! ➔ Skype: melnic-v ➔ Email: vladimir.melnic@wearepropeople.com

×