librato-rake-deploytrack 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
 - data/lib/tasks/deploy.rake +35 -0
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d84d7255f6f9bdcab1812c26492137dbc33b0be1
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e25415f6ccf4c158c0c3b1e9e08c054c33fee001
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f17d638a4f75f82e0217f8e31b5d2aeaa431c7d831b41aeb1e09e4a45a64349b4f88ef566c03cb2d0f4f0713743ed1a783dd22e4d0a2fda25df731c8900cb1cf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 81b14517324aefc3be6a9ab67fc5068336941e6e7b508263c82246bc37d131b35240bace71dfa3f15f23c4c88df98f37ea8d24fcc8d821cc9b7567fa1cf614a4
         
     | 
| 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'librato/metrics'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            user   = ENV['LIBRATO_USER'] || ENV['LIBRATO_METRICS_USER']
         
     | 
| 
      
 4 
     | 
    
         
            +
            token  = ENV['LIBRATO_TOKEN'] || ENV['LIBRATO_METRICS_TOKEN']
         
     | 
| 
      
 5 
     | 
    
         
            +
            source = ENV['LIBRATO_SOURCE'] || ENV['LIBRATO_METRICS_SOURCE'] || 'production'
         
     | 
| 
      
 6 
     | 
    
         
            +
            file   = ENV['LIBRATO_DEPLOY_FILE'] ||'librato-rake-deploytrack-deploy-id'
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Librato::Metrics.authenticate user, token
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            namespace :librato do
         
     | 
| 
      
 11 
     | 
    
         
            +
              namespace :deploy do
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                desc "Mark a deployment start in librato metrics annotations streams"
         
     | 
| 
      
 14 
     | 
    
         
            +
                task :start, :title, :description do |task, args|
         
     | 
| 
      
 15 
     | 
    
         
            +
                  r = Librato::Metrics.annotate :deployments, args[:title], :source => source, :start_time => Time.now.to_i, :description => args[:description]
         
     | 
| 
      
 16 
     | 
    
         
            +
                  File.open(file, 'w') { |file| file.write r['id'] }
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                desc "Mark a previously started (rake librato:deploy:start) deploy as finished in librato metrics annotations streams"
         
     | 
| 
      
 20 
     | 
    
         
            +
                task :end do
         
     | 
| 
      
 21 
     | 
    
         
            +
                  id = File.read(file).to_i
         
     | 
| 
      
 22 
     | 
    
         
            +
                  annotator = Librato::Metrics::Annotator.new
         
     | 
| 
      
 23 
     | 
    
         
            +
                  annotator.update_event :deployments, id, :end_time => Time.now.to_i
         
     | 
| 
      
 24 
     | 
    
         
            +
                  File.delete(file) 
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            #    desc "List annotations"
         
     | 
| 
      
 28 
     | 
    
         
            +
            #    task :list do
         
     | 
| 
      
 29 
     | 
    
         
            +
            #      annotator = Librato::Metrics::Annotator.new
         
     | 
| 
      
 30 
     | 
    
         
            +
            #      p annotator.fetch_event :deployments, File.read(file).to_i if File.exists?(file)
         
     | 
| 
      
 31 
     | 
    
         
            +
            #      p annotator.fetch :deployments
         
     | 
| 
      
 32 
     | 
    
         
            +
            #    end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              end
         
     | 
| 
      
 35 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: librato-rake-deploytrack
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ole Michaelis
         
     | 
| 
         @@ -47,7 +47,8 @@ extensions: [] 
     | 
|
| 
       47 
47 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       48 
48 
     | 
    
         
             
            files:
         
     | 
| 
       49 
49 
     | 
    
         
             
            - lib/librato-rake-deploytrack.rb
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
            - lib/tasks/deploy.rake
         
     | 
| 
      
 51 
     | 
    
         
            +
            homepage: https://github.com/Jimdo/librato-rake-deploytrack
         
     | 
| 
       51 
52 
     | 
    
         
             
            licenses:
         
     | 
| 
       52 
53 
     | 
    
         
             
            - MIT
         
     | 
| 
       53 
54 
     | 
    
         
             
            metadata: {}
         
     |