Phing and drupal
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
2,360
On Slideshare
1,433
From Embeds
927
Number of Embeds
14

Actions

Shares
Downloads
6
Comments
1
Likes
1

Embeds 927

http://wearepropeople.com 722
http://cloud.feedly.com 137
http://www.newsblur.com 16
http://summary 12
http://digg.com 11
http://www.feedspot.com 8
http://newsblur.com 7
http://feed.webphp.com.br 6
http://dev.newsblur.com 2
http://feeds.feedburner.com 2
http://trentboeschen.com 1
http://inoreader.com 1
http://feedly.com 1
http://drupalfanatics.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Phing and Drupal First steps to contiuous integration Vladimir Melnic vladimir.melnic@wearepropeople.com
  • 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. 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. 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. Demo ➔ git@bitbucket.org:vladimir_m/soldanesti.org_make.git ➔ cd soldanesti.org/ ➔ phing ➔ https://bitbucket.org/vladimir_m/soldanesti.org_make
  • 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. 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. 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. 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. 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. 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. 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. 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. 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. Thank You!Thank You! ➔ Skype: melnic-v ➔ Email: vladimir.melnic@wearepropeople.com