Drupal & Continous Integration - SF State Study Case

36
Drupal @ SF State 2011 Continuous Integration Emanuele Quinto and Supakit Kiatrungrit (Nat) Identity Management/Portal

description

HigherEd Drupal Summit @ BADCamp 2011 (http://2011.badcamp.net/higher-education-drupal-summit)Cal State San Francisco will talk about how they implemented their drupal development cycle process based on continuous integration and QuickBuild.

Transcript of Drupal & Continous Integration - SF State Study Case

Page 1: Drupal & Continous Integration - SF State Study Case

Drupal @ SF State 2011Continuous Integration

Emanuele Quinto and Supakit Kiatrungrit (Nat)Identity Management/Portal

Page 2: Drupal & Continous Integration - SF State Study Case

2

Continuous Integration

Definition

• Phing• Drush• Apache Ant• QuickBuild

Tools & Technologies

• Portal (internal site) / Web Content (public sites)• Testing• Deploying

Quickbuild + Drupal @ SF State

Page 3: Drupal & Continous Integration - SF State Study Case

3

What is Continous Integration?

• Implements continuous processes of applying quality control — small pieces of effort, applied frequently.Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development.

Wikipedia

• Members of a team integrate their work frequently.• Integration is verified by an automated build

(including test) to detect integration errors as quickly as possible.

Practically

Page 4: Drupal & Continous Integration - SF State Study Case

4

Drush

drush is a command line shell scripting interface for Drupal, a veritable Swiss Army knife designed to perform Drupal tasks from the command line on your web server.

• admin tasks quicker than via the web interface;

• scriptability of common tasks;

• keeping up to date.

What can DRUSH do for you?

Page 5: Drupal & Continous Integration - SF State Study Case

5

Drush commands

$ drush help <command>

• Works for modules and themes!

$ drush dl <package>

$ drush en <package>

$ drush dis <package>

• DB integration$ drush sql-conf

$ drush sqlc

$ drush sql-dump

$ drush cc

Page 6: Drupal & Continous Integration - SF State Study Case

6

Drush example

$ ssh server1

$ cd /var/www/d7site

$ drush dl views

$ drush en views

$ ssh server1

$ cd /var/www/d7site/sites/all/modules

GOTO drupal.org

$ curl http://ftp.drupal.org/files/projec

ts/views-7.x-3.0-rc1.tar.gz

$ tar –xzf views-7.x-3.0-rc1.tar.gz

GOTO /admin/build/modules

enable and save

Page 7: Drupal & Continous Integration - SF State Study Case

7

Phing

• PHP project build system/tool based on Apache Ant.

PHing Is Not GNU make

• “GNU make” functionalities;• XML build files;• PHP "task" classes;• SimpleTest unit tests;• Shell/Drush scripts• file system operations;• MySQL execution;• SVN operations

Features

Page 8: Drupal & Continous Integration - SF State Study Case

8

Phing example (1)

<copy todir=“build”> <fileset defaultexcludes="false"

expandsymboliclinks="true"

dir="."> <include name="**/*.php" /> </fileset></copy>

• File System Task

<simpletest todir="results"> <formatter type="plain"/>

<fileset dir="tests"> <include name="**/*Test*.php"/>

<exclude name="**/Abstract*.php"/> </fileset> </simpletest>

• Simple Test Task

Page 9: Drupal & Continous Integration - SF State Study Case

9

Phing example (2)

<if> <equals arg1="${foo}" arg2="bar" /> <then> <echo message="The value of property foo is bar" /> </then> <else> <echo message="The value of property foo is not bar" /> </else> </if>

• Conditional Task

<exec command="ls -l"

dir="/home"

checkreturn="true"/>

• Execution Task

Page 10: Drupal & Continous Integration - SF State Study Case

10

Apache Ant

• Java-based build tool: Java library and command-line;

Apache Ant "Another Neat Tool”

• main usage is the build of Java applications;• used effectively to build non Java applications;• Java Class like extensions;• build files in XML;• Standardized and Platform Independent;

Features

Page 11: Drupal & Continous Integration - SF State Study Case

11

Apache Ant example

<jmeter jmeterhome="${jmeter.path}”

resultlog=“${jmeter.report.dir} /JMeterResults.jtl” failureProperty="jmeter.failed">

<testplans dir="source" includes=”app.jmx" />

</jmeter>

• JMeter Test Task

Page 12: Drupal & Continous Integration - SF State Study Case

12

JMeter

Ant

Phing

Ant / Phing / Quickbuild

Page 13: Drupal & Continous Integration - SF State Study Case

13

QUICKBUILD

Page 14: Drupal & Continous Integration - SF State Study Case

14

QuickBuild

• Object Oriented Based Continuous Integration

QuickBuild

• Supported SCM systems: Subversion, CVS, Perforce, ClearCase, StarTeam, Visual SourceSafe, Accurev, Git, Mercurial, Bazaar, Team

• Supports Issue Traker systems: JIRA, Trac, Bugzilla, CollabNet TeamForge, and Redmine.

• Advanced Build Grid

Features

Page 15: Drupal & Continous Integration - SF State Study Case

15

QuickBuild

• Native support for mainstream code inspection and coverage tools, including checkstyle, findbugs, emma, pmd, and cobertura.

• Extensible via Plugins and RESTful API • Proof Build• Support to notify through: RSS, Email, MSN

Messenger, Google Talk, Jabber, and the cross-platform tray monitor.

• Customizable User Dashboards

Features

Page 16: Drupal & Continous Integration - SF State Study Case

16

QuickBuild Dashboard

Buildsummary

Buildconfigurations

Page 17: Drupal & Continous Integration - SF State Study Case

17

QB Testing (1)

Next Muniportletbuild

Page 18: Drupal & Continous Integration - SF State Study Case

18

QB Testing (Next Muni Portlet)

Page 19: Drupal & Continous Integration - SF State Study Case

19

QB Testing (2)

Testhistory

Page 20: Drupal & Continous Integration - SF State Study Case

20

QB Testing (3)

error

Testdetails

Failedtest

Page 21: Drupal & Continous Integration - SF State Study Case

21

QB Testing (4)

OK

Page 22: Drupal & Continous Integration - SF State Study Case

22

PORTAL DEPLOYMENT

Page 23: Drupal & Continous Integration - SF State Study Case

23

Drupal Servers (Portal)

Page 24: Drupal & Continous Integration - SF State Study Case

24

Development Cycle

Local machine

Dev

Test

Staging

Production

Manual on request

Manual on request

5am

Manual

Branching from SVN Develop code Run unit tests Check into SVN

Additional development Interface testing Merge back to trunk

Verify automated tests User acceptance testing Content is added directly here

Automated tests run If any tests fail, there is no push

to production

Management approval Tags from SVN

Automated tests If any tests fail, system is rolled back to

previous build

Page 25: Drupal & Continous Integration - SF State Study Case

25

Deployment (1)

Portal deployment

Page 26: Drupal & Continous Integration - SF State Study Case

26

Deployment (2)Automated Deployment

Project

Step 3

Step 1

Step 2

Page 27: Drupal & Continous Integration - SF State Study Case

27

Deployment (3)

Step 1.3

Step 1.3.1

Page 28: Drupal & Continous Integration - SF State Study Case

28

WEB CONTENT DEPLOYMENT

Page 29: Drupal & Continous Integration - SF State Study Case

29

Drupal Servers (Web Content)

Page 30: Drupal & Continous Integration - SF State Study Case

30

Acquia

Servermanagement

Page 31: Drupal & Continous Integration - SF State Study Case

31

Acquia dashboard

databases

file

code

Page 32: Drupal & Continous Integration - SF State Study Case

32

Acquia + QuickBuild (1)

Development process

Page 33: Drupal & Continous Integration - SF State Study Case

33

Acquia + QuickBuild (2)

SVN

branchingfilesystem database Drupal

DEV

Page 34: Drupal & Continous Integration - SF State Study Case

34

Acquia + QuickBuild (3)

Drupal DEV

GIT merging filesystem database

Page 35: Drupal & Continous Integration - SF State Study Case

35

THANK YOU

Q & A

Page 36: Drupal & Continous Integration - SF State Study Case

36

About us

Supakit Kiatrungrit (Nat)[email protected]

http://www.linkedin.com/pub/supakit-kiatrungrit/6/174/888

Emanuele Quinto [email protected]

http://www.linkedin.com/in/emanuelequinto

@emaV