deploy_and_deliver 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +46 -0
 - data/Rakefile +55 -0
 - data/VERSION +1 -0
 - data/install.rb +1 -0
 - data/lib/deploy_and_deliver/recipes.rb +41 -0
 - data/recipes/deploy_and_deliver.rb +1 -0
 - metadata +60 -0
 
    
        data/README
    ADDED
    
    | 
         @@ -0,0 +1,46 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Deploy and Deliver
         
     | 
| 
      
 2 
     | 
    
         
            +
            ==================
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            Capistrano recipes for Pivotal Tracker.
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            To use this task, simply set the following variables:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              set :pivotal_tracker_project_id, PROJECT_ID
         
     | 
| 
      
 10 
     | 
    
         
            +
              set :pivotal_tracker_token, TOKEN
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            Then, inside the task for your demo platform, add
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              task :demo do
         
     | 
| 
      
 15 
     | 
    
         
            +
                ...
         
     | 
| 
      
 16 
     | 
    
         
            +
                after :deploy, 'pivotal_tracker:deliver_stories'
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            Installation
         
     | 
| 
      
 21 
     | 
    
         
            +
            ============
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            Install as a plugin:
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              script/plugin install git://github.com/collectiveidea/deploy_and_deliver.git
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            Install as a gem:
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              gem install collectiveidea-deploy_and_deliver --source http://gems.github.com
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              Add the following in your Capistrano config to load the recipes:
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                require 'deploy_and_deliver/recipes'
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            Bonus Output
         
     | 
| 
      
 37 
     | 
    
         
            +
            ============
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            As an added bonus, if you have Paul Dix's sax-machine gem installed (it's a SAX object parser that uses nokogiri), you'll even get a brief summary report of the delivered stories in your cap output.
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            Credits
         
     | 
| 
      
 44 
     | 
    
         
            +
            =======
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            Pluginized and Gemified by Collective Idea (http://collectiveidea.com) based on code from Mike Dalessio, Pivotal Labs (http://pivotallabs.com/users/miked/blog/articles/702-deliver-tracker-stories-from-capistrano)
         
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,55 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rake'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            begin
         
     | 
| 
      
 5 
     | 
    
         
            +
              require 'jeweler'
         
     | 
| 
      
 6 
     | 
    
         
            +
              Jeweler::Tasks.new do |gem|
         
     | 
| 
      
 7 
     | 
    
         
            +
                gem.name = "deploy_and_deliver"
         
     | 
| 
      
 8 
     | 
    
         
            +
                gem.summary = %Q{Capistrano recipes for Pivotal Tracker}
         
     | 
| 
      
 9 
     | 
    
         
            +
                gem.description = %Q{Mark Pivotal Tracker stories as Delivered on deploy.}
         
     | 
| 
      
 10 
     | 
    
         
            +
                gem.email = "daniel@collectiveidea.com"
         
     | 
| 
      
 11 
     | 
    
         
            +
                gem.homepage = "http://github.com/danielmorrison/deploy_and_deliver"
         
     | 
| 
      
 12 
     | 
    
         
            +
                gem.authors = ["Daniel Morrison"]
         
     | 
| 
      
 13 
     | 
    
         
            +
                # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 16 
     | 
    
         
            +
              puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            require 'rake/testtask'
         
     | 
| 
      
 20 
     | 
    
         
            +
            Rake::TestTask.new(:test) do |test|
         
     | 
| 
      
 21 
     | 
    
         
            +
              test.libs << 'lib' << 'test'
         
     | 
| 
      
 22 
     | 
    
         
            +
              test.pattern = 'test/**/*_test.rb'
         
     | 
| 
      
 23 
     | 
    
         
            +
              test.verbose = true
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            begin
         
     | 
| 
      
 27 
     | 
    
         
            +
              require 'rcov/rcovtask'
         
     | 
| 
      
 28 
     | 
    
         
            +
              Rcov::RcovTask.new do |test|
         
     | 
| 
      
 29 
     | 
    
         
            +
                test.libs << 'test'
         
     | 
| 
      
 30 
     | 
    
         
            +
                test.pattern = 'test/**/*_test.rb'
         
     | 
| 
      
 31 
     | 
    
         
            +
                test.verbose = true
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 34 
     | 
    
         
            +
              task :rcov do
         
     | 
| 
      
 35 
     | 
    
         
            +
                abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
            end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            task :test => :check_dependencies
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            task :default => :test
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            require 'rake/rdoctask'
         
     | 
| 
      
 44 
     | 
    
         
            +
            Rake::RDocTask.new do |rdoc|
         
     | 
| 
      
 45 
     | 
    
         
            +
              if File.exist?('VERSION')
         
     | 
| 
      
 46 
     | 
    
         
            +
                version = File.read('VERSION')
         
     | 
| 
      
 47 
     | 
    
         
            +
              else
         
     | 
| 
      
 48 
     | 
    
         
            +
                version = ""
         
     | 
| 
      
 49 
     | 
    
         
            +
              end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
              rdoc.rdoc_dir = 'rdoc'
         
     | 
| 
      
 52 
     | 
    
         
            +
              rdoc.title = "deploy_and_deliver #{version}"
         
     | 
| 
      
 53 
     | 
    
         
            +
              rdoc.rdoc_files.include('README*')
         
     | 
| 
      
 54 
     | 
    
         
            +
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
      
 55 
     | 
    
         
            +
            end
         
     | 
    
        data/VERSION
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            1.0.0
         
     | 
    
        data/install.rb
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            puts IO.read(File.join(File.dirname(__FILE__), 'README'))
         
     | 
| 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Capistrano::Configuration.instance.load do
         
     | 
| 
      
 2 
     | 
    
         
            +
              
         
     | 
| 
      
 3 
     | 
    
         
            +
              namespace :pivotal_tracker do
         
     | 
| 
      
 4 
     | 
    
         
            +
                desc "deliver your project's 'finished' stories"
         
     | 
| 
      
 5 
     | 
    
         
            +
                task :deliver_stories do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  require 'rubygems'
         
     | 
| 
      
 7 
     | 
    
         
            +
                  require 'activeresource'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  class Story < ActiveResource::Base
         
     | 
| 
      
 10 
     | 
    
         
            +
                    self.site = "http://www.pivotaltracker.com/services/v2/projects/:project_id"
         
     | 
| 
      
 11 
     | 
    
         
            +
                  end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  Story.headers['X-TrackerToken'] = pivotal_tracker_token
         
     | 
| 
      
 14 
     | 
    
         
            +
                  puts "* delivering tracker stories ..."
         
     | 
| 
      
 15 
     | 
    
         
            +
                  response = Story.put(:deliver_all_finished, :project_id => pivotal_tracker_project_id)
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 18 
     | 
    
         
            +
                    require 'sax-machine'
         
     | 
| 
      
 19 
     | 
    
         
            +
                    class Story
         
     | 
| 
      
 20 
     | 
    
         
            +
                      include SAXMachine
         
     | 
| 
      
 21 
     | 
    
         
            +
                      element :name
         
     | 
| 
      
 22 
     | 
    
         
            +
                      element :story_type
         
     | 
| 
      
 23 
     | 
    
         
            +
                      element :estimate
         
     | 
| 
      
 24 
     | 
    
         
            +
                      element :description
         
     | 
| 
      
 25 
     | 
    
         
            +
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
                    class Stories
         
     | 
| 
      
 27 
     | 
    
         
            +
                      include SAXMachine
         
     | 
| 
      
 28 
     | 
    
         
            +
                      elements :story, :as => :stories, :class => Story
         
     | 
| 
      
 29 
     | 
    
         
            +
                    end
         
     | 
| 
      
 30 
     | 
    
         
            +
                    doc = Stories.parse(response.body)
         
     | 
| 
      
 31 
     | 
    
         
            +
                    puts "* delivered #{doc.stories.length} stories"
         
     | 
| 
      
 32 
     | 
    
         
            +
                    doc.stories.each do |story|
         
     | 
| 
      
 33 
     | 
    
         
            +
                      puts "  - #{story.story_type}: #{story.name} (#{story.estimate} points)"
         
     | 
| 
      
 34 
     | 
    
         
            +
                    end
         
     | 
| 
      
 35 
     | 
    
         
            +
                  rescue LoadError => e
         
     | 
| 
      
 36 
     | 
    
         
            +
                    puts "* stories delivered."
         
     | 
| 
      
 37 
     | 
    
         
            +
                  end
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
              
         
     | 
| 
      
 41 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'deploy_and_deliver', 'recipes'))
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,60 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification 
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: deploy_and_deliver
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors: 
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Daniel Morrison
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2009-09-23 00:00:00 -04:00
         
     | 
| 
      
 13 
     | 
    
         
            +
            default_executable: 
         
     | 
| 
      
 14 
     | 
    
         
            +
            dependencies: []
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            description: Mark Pivotal Tracker stories as Delivered on deploy.
         
     | 
| 
      
 17 
     | 
    
         
            +
            email: daniel@collectiveidea.com
         
     | 
| 
      
 18 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            extra_rdoc_files: 
         
     | 
| 
      
 23 
     | 
    
         
            +
            - README
         
     | 
| 
      
 24 
     | 
    
         
            +
            files: 
         
     | 
| 
      
 25 
     | 
    
         
            +
            - README
         
     | 
| 
      
 26 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 27 
     | 
    
         
            +
            - VERSION
         
     | 
| 
      
 28 
     | 
    
         
            +
            - install.rb
         
     | 
| 
      
 29 
     | 
    
         
            +
            - lib/deploy_and_deliver/recipes.rb
         
     | 
| 
      
 30 
     | 
    
         
            +
            - recipes/deploy_and_deliver.rb
         
     | 
| 
      
 31 
     | 
    
         
            +
            has_rdoc: true
         
     | 
| 
      
 32 
     | 
    
         
            +
            homepage: http://github.com/danielmorrison/deploy_and_deliver
         
     | 
| 
      
 33 
     | 
    
         
            +
            licenses: []
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 36 
     | 
    
         
            +
            rdoc_options: 
         
     | 
| 
      
 37 
     | 
    
         
            +
            - --charset=UTF-8
         
     | 
| 
      
 38 
     | 
    
         
            +
            require_paths: 
         
     | 
| 
      
 39 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 40 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 41 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 42 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 43 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 44 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 45 
     | 
    
         
            +
              version: 
         
     | 
| 
      
 46 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 47 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 48 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 49 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 50 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 51 
     | 
    
         
            +
              version: 
         
     | 
| 
      
 52 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 55 
     | 
    
         
            +
            rubygems_version: 1.3.5
         
     | 
| 
      
 56 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 57 
     | 
    
         
            +
            specification_version: 3
         
     | 
| 
      
 58 
     | 
    
         
            +
            summary: Capistrano recipes for Pivotal Tracker
         
     | 
| 
      
 59 
     | 
    
         
            +
            test_files: []
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     |