mina-appsignal 0.0.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ae978398c17fd96ad2f32a304b64cf636a91b6f4
4
- data.tar.gz: 2bc546cd2f9a0e1001cd6d0c8f1e9ba5a071b143
2
+ SHA256:
3
+ metadata.gz: 7ca833636bbc9063a3c903c3bb37a6d45f01e16bb830e311f4225c7911b31070
4
+ data.tar.gz: e87eab826476d29798943ab49da46c264bfe965ef766841fa00496b1bc2b2af7
5
5
  SHA512:
6
- metadata.gz: 57d8651070888f309e3cbd6a61dbfa9441407788398f338d20d4dfd2664691b4d5ba813129938add86e2427b79b6b5ce84e324d9bb8a571ea27000db11b0385a
7
- data.tar.gz: 6de37d0f1f9f61d684175cfcb7c14a07a0ace0ed4750f5b4cd3e83ea6a0d3548996e2f977ed5615da59eee4d4b589f15dd4a1f516a9f0c4e083fa1d505504d41
6
+ metadata.gz: 706f0b670de8e93f0ce316cb772cb980bf02eaee284d78d18bd7980195eb5a048a404ebd6b4c1d82a279c7d6d51e865ebcd68c49ee12183ee3cc6c4cca5bc451
7
+ data.tar.gz: 3e133933fec7d3a6161d7528cfd1460d092f1ce1143e72e10c350d61095296b11bb14cc8de335514ae4d59a852823fde8d3759ba47aa111a3e6310566e2f790a
data/.editorconfig ADDED
@@ -0,0 +1,14 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_style = space
7
+ insert_final_newline = true
8
+
9
+ [*.{rb,spec}]
10
+ indent_size = 2
11
+ trim_trailing_whitespace = true
12
+
13
+ [*.[md,MD,markdown}]
14
+ indent_size = 2
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Mina::AppSignal [![Build Status](https://travis-ci.org/code-lever/mina-appsignal.png)](https://travis-ci.org/code-lever/mina-appsignal) [![Dependency Status](https://gemnasium.com/code-lever/mina-appsignal.png)](https://gemnasium.com/code-lever/mina-appsignal) [![Code Climate](https://codeclimate.com/github/code-lever/mina-appsignal.png)](https://codeclimate.com/github/code-lever/mina-appsignal)
1
+ # Mina::AppSignal [![Build Status](https://travis-ci.org/code-lever/mina-appsignal.png)](https://travis-ci.org/code-lever/mina-appsignal) [![Code Climate](https://codeclimate.com/github/code-lever/mina-appsignal.png)](https://codeclimate.com/github/code-lever/mina-appsignal)
2
2
 
3
3
  [Mina](https://github.com/mina-deploy/mina) tasks for interacting with [AppSignal](http://appsignal.com).
4
4
 
@@ -50,7 +50,6 @@ If not, you'll need to set some options.
50
50
  | `appsignal_app_name` | AppSignal application name |
51
51
  | | Read from `config/appsignal.yml` or `ENV['APPSIGNAL_APP_NAME']` if available |
52
52
  | `appsignal_local_username` | Local username of deploying user (optional) |
53
- | `appsignal_notification_debug` | `true` to enable notification debugging info |
54
53
 
55
54
  ## Contributing
56
55
 
@@ -28,63 +28,57 @@ require 'shellwords'
28
28
  # Any and all of these settings can be overriden in your `deploy.rb`.
29
29
 
30
30
  # ### appsignal_api_key
31
- # Sets the push api key for your AppSignal account. Will be read from
31
+ # Sets the push api key for your AppSignal account. Will be read from
32
32
  # config/appsignal.yml, or the APPSIGNAL_PUSH_API_KEY if not set. Required.
33
- set_default :appsignal_api_key, nil
33
+ set :appsignal_api_key, nil
34
34
 
35
35
  # ### appsignal_app_name
36
- # Sets the name of the app being deployed. Will be read from
36
+ # Sets the name of the app being deployed. Will be read from
37
37
  # config/appsignal.yml, or the APPSIGNAL_APP_NAME if not set. Required.
38
- set_default :appsignal_app_name, nil
38
+ set :appsignal_app_name, nil
39
39
 
40
40
  # ### appsignal_local_username
41
41
  # Sets the name of the user who deployed. Defaults to `whoami`. Optional.
42
- set_default :appsignal_local_username, %x[whoami].strip rescue nil
43
-
44
- # ### appsignal_notification_debug
45
- # If true, enables verbosity in the notification to help debug issues. Defaults to false.
46
- set_default :appsignal_notification_debug, false
42
+ set :appsignal_local_username, %x[whoami].strip rescue nil
47
43
 
48
44
  namespace :appsignal do
49
45
 
50
46
  desc 'Notifies AppSignal of your deployment'
51
47
  task notify: :environment do
52
-
53
- api_key = appsignal_api_key
54
- api_key ||= Mina::AppSignal.from_config(rails_env, 'push_api_key')
48
+ api_key = fetch(:appsignal_api_key)
49
+ api_key ||= Mina::AppSignal.from_config(fetch(:rails_env), 'push_api_key')
55
50
  api_key ||= ENV['APPSIGNAL_PUSH_API_KEY']
56
51
  unless api_key
57
52
  print_error '`:appsignal_api_key` must be defined to notify'
58
- exit
53
+ next
59
54
  end
60
55
 
61
- app_name = appsignal_app_name
62
- app_name ||= Mina::AppSignal.from_config(rails_env, 'name')
56
+ app_name = fetch(:appsignal_app_name)
57
+ app_name ||= Mina::AppSignal.from_config(fetch(:rails_env), 'name')
63
58
  app_name ||= ENV['APPSIGNAL_APP_NAME']
64
59
  unless app_name
65
60
  print_error '`:appsignal_app_name` must be defined to notify'
66
- exit
61
+ next
67
62
  end
68
63
 
69
- unless branch? || commit?
64
+ unless set?(:branch) || set?(:commit)
70
65
  print_error 'Must define either `:branch` or `:commit`'
71
- exit
66
+ next
72
67
  end
73
68
 
74
- revision = commit? ? commit : %x[git rev-parse #{branch}].strip
69
+ revision = set?(:commit) ? fetch(:commit) : %x[git rev-parse #{fetch(:branch)}].strip
75
70
 
76
71
  body = { revision: revision }
77
- body[:repository] = branch if branch?
78
- body[:user] = appsignal_local_username.shellescape if appsignal_local_username
72
+ body[:repository] = fetch(:branch) if set?(:branch)
73
+ body[:user] = fetch(:appsignal_local_username).shellescape if set?(:appsignal_local_username)
79
74
 
80
- silent = appsignal_notification_debug ? '-v' : '-s -o /dev/null'
75
+ silent = fetch(:appsignal_notification_debug) ? '-v' : '-s -o /dev/null'
81
76
  script = [%Q(curl #{silent} -X POST)]
82
77
  script << %Q(-d '#{body.to_json}')
83
- script << %Q("https://push.appsignal.com/1/markers?api_key=#{api_key}&name=#{app_name}&environment=#{rails_env}")
84
-
85
- queue! 'echo "-----> Notifying AppSignal of deployment"'
86
- queue script.join(' ')
78
+ script << %Q("https://push.appsignal.com/1/markers?api_key=#{api_key}&name=#{app_name}&environment=#{fetch(:rails_env)}")
87
79
 
80
+ comment %{Notifying AppSignal of deployment}
81
+ command %[#{script.join(' ')}]
88
82
  end
89
83
 
90
84
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module AppSignal
3
- VERSION = '0.0.2'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'mina', '~> 0.3'
21
+ spec.add_dependency 'mina', '~> 1.2'
22
+ spec.add_dependency 'json', '~> 2.1.0'
22
23
 
23
24
  spec.add_development_dependency 'awesome_print'
24
- spec.add_development_dependency 'bundler', '~> 1.6'
25
+ spec.add_development_dependency 'bundler', '~> 2.3'
25
26
  spec.add_development_dependency 'ci_reporter', '~> 1.9'
26
27
  spec.add_development_dependency 'pry'
27
28
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Veys
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mina
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.3'
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.1.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: awesome_print
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,14 @@ dependencies:
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.6'
61
+ version: '2.3'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '1.6'
68
+ version: '2.3'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: ci_reporter
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +213,7 @@ executables: []
199
213
  extensions: []
200
214
  extra_rdoc_files: []
201
215
  files:
216
+ - ".editorconfig"
202
217
  - ".gitignore"
203
218
  - Gemfile
204
219
  - LICENSE.txt
@@ -213,7 +228,7 @@ homepage: https://github.com/code-lever/mina-appsignal
213
228
  licenses:
214
229
  - MIT
215
230
  metadata: {}
216
- post_install_message:
231
+ post_install_message:
217
232
  rdoc_options: []
218
233
  require_paths:
219
234
  - lib
@@ -228,9 +243,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
243
  - !ruby/object:Gem::Version
229
244
  version: '0'
230
245
  requirements: []
231
- rubyforge_project:
232
- rubygems_version: 2.5.1
233
- signing_key:
246
+ rubygems_version: 3.2.22
247
+ signing_key:
234
248
  specification_version: 4
235
249
  summary: Mina tasks for AppSignal
236
250
  test_files: []