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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tasks/deploy.rake +35 -0
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ef482207a5f8679208323559a351356c221b69a
4
- data.tar.gz: e246ba1ca977a511018c2e4fd17309f57bc9883d
3
+ metadata.gz: d84d7255f6f9bdcab1812c26492137dbc33b0be1
4
+ data.tar.gz: e25415f6ccf4c158c0c3b1e9e08c054c33fee001
5
5
  SHA512:
6
- metadata.gz: 361391e66a2adb956201fd3e4643a92edd408d05071f05542fd736a98a169644d630cb14d8d447ed887a76d07afc824c92397727587d1ac0292c538437931888
7
- data.tar.gz: 69b3af5de99e0c2b5342ba61bf912f005346af8c06a8eab47c95e21eee22f79dfb6e9c90648de13da0a37301bf11b5f748630ca5fec62afa92b3773491835456
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.3
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
- homepage: http://rubygems.org/gems/librato-rake-deploytrack
50
+ - lib/tasks/deploy.rake
51
+ homepage: https://github.com/Jimdo/librato-rake-deploytrack
51
52
  licenses:
52
53
  - MIT
53
54
  metadata: {}