Continuous integration with Git & CI Joe
Upcoming SlideShare
Loading in...5
×
 

Continuous integration with Git & CI Joe

on

  • 7,293 views

 

Statistics

Views

Total Views
7,293
Views on SlideShare
7,292
Embed Views
1

Actions

Likes
5
Downloads
56
Comments
0

1 Embed 1

https://duckduckgo.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Continuous integration with Git & CI Joe Continuous integration with Git & CI Joe Presentation Transcript

    • Simple Continuous Integration using Git and  CI Joe
      Shawn Price drupal.org: langworthy twitter: @sprice
    • Continuous Integration Defined
      "Continuous Integration is a software development practice where members of a team integrate their work frequently..." "Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly" - Martin Fowler
      martinfowler.com/articles/continuousIntegration.html
    • Continuous Integration Defined
      Continuous Integration is a fancy term for “run your project’s tests after someone pushes to the repository and notify interested parties if they fail” - Chris Wanstrath
      github.com/blog/471-continuous-integration-spring-cleaning
    • Components of Continuous Integration
      • Use a code repository
      • Test your code
      • Automate the testing
    • Use a code repository
    • Use a code repository
      In the beginning there was FTP.
    • Use a code repository
      In the beginning there was FTP. And things were good.
    • Use a code repository
      5 minutes later....
    • Use a code repository
      5 minutes later.... Things were bad.
    • Use a code repository
      5 minutes later.... Things were bad. "Who made that change?" "There's a bug, lets put the previous version of the file back" etc.
    • Use a code repository
      Greetings Git!
    • Use a code repository
      Greetings Git! A free & open source distributed version control system.
      • git-scm.com/
      • progit.org/book/
      • drupal.org/community-initiatives/git
    • Use a code repository
      Using a code repository allows teams to:
      • track the history of changes
      • use branches to manage feature integration
      • efficiently deploy to production
      • efficiently roll-back changes
    • Use a code repository
      Meet the Amazing Module!
    • Use a code repository
      DEMO time: 
      • Create a new git repository
      • Include Drupal and the Amazing module
    • Test your code
    • Test your code
      Drupal 6: drupal.org/project/simpletest Simpletest is in Drupal 7 core.
    • Test your code
      amazing.test
      <?php
      class AmazingTestCase extends DrupalWebTestCase {    public static function getInfo () {      return array (        'name' => t( 'Amazing functionality' ),        'description' => ( 'Test for amazingness' ),        'group' => t( 'Amazing' ),      );    }    function setUp () {      parent:: setUp ( 'amazing' );    }    public function testAmazingPageContent () {      $this -> drupalGet ( &quot;amazing&quot; );      $this -> assertResponse ( 200 );      $this -> assertText (t( 'Simply amazing!' ));    } }
    • Test your code
      DEMO time:
      • running tests in the Drupal UI
      • running tests with drush -  github.com/yhahn/drush_test
    • Automate the testing
    • Automate the testing
      Choosing a Continuous Integration server
    • Automate the testing
      Choosing a Continuous Integration server
      • Hudson?
      • Cruise Control?
      • and more...
    • Automate the testing
      Choosing a Continuous Integration server
      • Hudson? (Java)
      • Cruise Control? (Java)
      • and more... (many are tricky to install)
    • Automate the testing
      Meet CI Joe! github.com/defunkt/cijoe
    • Automate the testing
      CI Joe was created out of the desire to do CI simply
      • configure via git config
      • $ git config --add cijoe.runner &quot;drush test MyTestCase&quot;
      • use git hooks for notifications
      • easy to install with few dependencies (Ruby)
      • $ gem install cijoe
      • $ git clone git://github.com/you/yourrepo.git
      • $ cijoe yourrepo
    • Automate the testing
      • CI Joe runs when it receives a POST
    • Automate the testing
      • CI Joe runs when it receives a POST
      • $ curl -d &quot;payload&quot; http://ci.example.com:4567
    • Automate the testing
      • Notifications are sent via git hooks
    • Automate the testing
      • Notifications are sent via git hooks
           .git/hooks/build-worked
      • #!/bin/bash
      • EMAIL=&quot;me@example.com&quot;
      • /usr/sbin/sendmail &quot;$EMAIL&quot; <<EOD
      • To: $EMAIL
      • Subject: Your tests passed
      • From: Testbot <testbot@ci.example.com>
      • The latest integrations are good. The tests passed.
      • EOD
    • Automate the testing
      • Notifications are sent via git hooks
           .git/hooks/build-failed
      • #!/bin/bash
      • EMAIL=&quot;me@example.com&quot;
      • /usr/sbin/sendmail &quot;$EMAIL&quot; <<EOD
      • To: $EMAIL
      • Subject: Your tests failed
      • From: Testbot <testbot@ci.example.com>
      • The latest integrations are bad. The tests failed. Better luck next time.
      • EOD
    • Bringing it all together
      • push changes to remote git repository
    • Bringing it all together
      • push changes to remote git repository
      • Post-Receive URL triggers a POST to CI Joe
    • Bringing it all together
      • push changes to remote git repository
      • Post-Receive URL triggers a POST to CI Joe
      • CI Joe runs tests
    • Bringing it all together
      • push changes to remote git repository
      • Post-Receive URL triggers a POST to CI Joe
      • CI Joe runs tests
      • CI Joe sends notification via git hook
    • Bringing it all together
      DEMO TIME!
    • Questions?
    • Thank You.