mina-instana 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mina/instana.rb +63 -0
- data/lib/mina/instana/version.rb +5 -0
- data/mina-instana.gemspec +30 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: aba6d58aad83bad177aa8c3d28be1992e6683665
|
4
|
+
data.tar.gz: aec452b20a54ae668c1590a43b68788c936c9244
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 68ed57d8cd325e14c88951d1a881f60d58758377d4b9c9019c8e13bc642df9d9f0e352fcb8d98b2dbe313862e2b74bf0a092675e268656abc9902fdefbe97924
|
7
|
+
data.tar.gz: 1ec4e46167c5476150720a64c2ce31361d495c8645d48c6f45753dfa326d187d0d3a3d5e970b2007a1f350255c3d3c7331338b1a338e73fa1e34d69646dd6a08
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Peter Giacomo Lombardo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# mina-instana
|
2
|
+
|
3
|
+
Send [Mina](http://nadarei.co/mina/) deploy events to Instana.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'mina-instana'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install mina-instana
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Add the following to your `config/deploy.rb`
|
24
|
+
```
|
25
|
+
require 'mina/instana'
|
26
|
+
```
|
27
|
+
Deploy...
|
28
|
+
|
29
|
+
Profit!
|
30
|
+
|
31
|
+
## Development
|
32
|
+
|
33
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
34
|
+
|
35
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/instana/mina-instana.
|
40
|
+
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
45
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "mina/instana"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/mina/instana.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "mina/instana/version"
|
3
|
+
require 'mina/hooks'
|
4
|
+
require 'net/http'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
before_mina :deploy, :'instana:start_deploy' if defined?(before_mina)
|
8
|
+
after_mina :deploy, :'instana:finish_deploy' if defined?(after_mina)
|
9
|
+
|
10
|
+
namespace :instana do
|
11
|
+
desc "Send start deploy notification to Instana"
|
12
|
+
task :start_deploy do
|
13
|
+
comment 'Sending deploy start notification to Instana'
|
14
|
+
|
15
|
+
return if simulate_mode?
|
16
|
+
|
17
|
+
payload = {}
|
18
|
+
repo_name = File.basename(%x[git rev-parse --show-toplevel]).strip
|
19
|
+
deployer = ENV['GIT_AUTHOR_NAME'] || %x[git config user.name].chomp
|
20
|
+
revision = ENV['GIT_COMMIT'] || %x[git rev-parse #{branch}].strip
|
21
|
+
|
22
|
+
payload[:title] = "Deploy started: #{repo_name}"
|
23
|
+
payload[:text] = "#{deployer} started deploy of #{repo_name}@#{revision[0..7]}"
|
24
|
+
|
25
|
+
begin
|
26
|
+
uri = URI('http://127.0.0.1:42699/com.instana.plugin.generic.event')
|
27
|
+
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
28
|
+
req.body = payload.to_json
|
29
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
30
|
+
http.request(req)
|
31
|
+
end
|
32
|
+
rescue => e
|
33
|
+
print_error "Error posting notification to Instana: #{e.inspect}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Send finish deploy notification to Instana"
|
38
|
+
task :finish_deploy do
|
39
|
+
comment 'Sending deploy finish notification to Instana'
|
40
|
+
|
41
|
+
return if simulate_mode?
|
42
|
+
|
43
|
+
payload = {}
|
44
|
+
repo_name = File.basename(%x[git rev-parse --show-toplevel]).strip
|
45
|
+
deployer = ENV['GIT_AUTHOR_NAME'] || %x[git config user.name].chomp
|
46
|
+
revision = ENV['GIT_COMMIT'] || %x[git rev-parse #{branch}].strip
|
47
|
+
|
48
|
+
payload[:title] = "Deploy finished: #{repo_name}"
|
49
|
+
payload[:text] = "#{deployer} finished deploy of #{repo_name}@#{revision[0..7]}"
|
50
|
+
|
51
|
+
begin
|
52
|
+
uri = URI('http://127.0.0.1:42699/com.instana.plugin.generic.event')
|
53
|
+
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
54
|
+
req.body = payload.to_json
|
55
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
56
|
+
http.request(req)
|
57
|
+
end
|
58
|
+
rescue
|
59
|
+
print_error "Error posting notification to Instana: #{e.inspect}"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mina/instana/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mina-instana"
|
8
|
+
spec.version = Mina::Instana::VERSION
|
9
|
+
spec.authors = ["Peter Giacomo Lombardo"]
|
10
|
+
spec.email = ["pglombardo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Post Mina deploy notifications to Instana.}
|
13
|
+
spec.description = %q{Post Mina deploy notifications to Instana.}
|
14
|
+
spec.homepage = "https://www.instana.com/"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "bin"
|
21
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "mina", ">= 0.2.1"
|
25
|
+
spec.add_dependency "mina-hooks"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-instana
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Giacomo Lombardo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mina-hooks
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.13'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.13'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.0'
|
83
|
+
description: Post Mina deploy notifications to Instana.
|
84
|
+
email:
|
85
|
+
- pglombardo@gmail.com
|
86
|
+
executables:
|
87
|
+
- console
|
88
|
+
- setup
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- lib/mina/instana.rb
|
101
|
+
- lib/mina/instana/version.rb
|
102
|
+
- mina-instana.gemspec
|
103
|
+
homepage: https://www.instana.com/
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata: {}
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 2.6.8
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Post Mina deploy notifications to Instana.
|
127
|
+
test_files: []
|