capistrano-raygun-deployment 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzZlZGU5YTE4MGVlM2E0NjRiNTUwNTMxMjEyM2VkZmFiYWIyNDA3Zg==
5
- data.tar.gz: !binary |-
6
- NThhNWMyYjkwNjgxYmRmODIyZjI2MTBiNWFkMDRjYjM3OTQ4Mzk4OQ==
2
+ SHA1:
3
+ metadata.gz: cd3eb376b4fb439dc564dfd18b074af4d4594247
4
+ data.tar.gz: ec166f1ddda030da2cfd38ee320c9ca25c2565ed
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MzI0OTA3MTBkMmZlNGYxNTBiMTdmZjBiZmY5Njc2MWVlYmYwNTcxNzQyNGYy
10
- MGQ0OGFkNjhiMThiMTU1MmNlMTk0YzJkMjJmOWU3ZjZmYjZiYmIzYTA3Yjk2
11
- MzRjNzQxYWE3OTM5NGNiMWYxNjJlM2E4MjFkZjk0NzJiMDJlODU=
12
- data.tar.gz: !binary |-
13
- MzMwNzJmZWQ3MTk2NzcwYTkwNjYzNDkzZjY2OTAzMTA1NzEzNThkMTAxZjk3
14
- YjYxODExZDAwMTgxOTdiN2IwZWY3NmZlZjRlODhiMzUwNDI4ZWU1OTZiYWY2
15
- ODU3ZjRjODg0OTk2ZTg1MzQxMDRkOGJiM2RlYjNiY2M4YmMzMWE=
6
+ metadata.gz: f5c3593c6600971294d2c2b3dd723f4a971d0be557680484db57fa89ab3ab91e9f00f02d9ebc0a3ab5726d51459856f287d5d781d1557e4386491f68e04648b6
7
+ data.tar.gz: 64e611879018d7c4afdbc84a150958ef10fd58b29d11bdb3edba999e30da9eca2fd6c9fc30b8a822525b4f67ebe3bc9a30c39390b8ee3ab271d329fbe7e5baa0
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2015 Mindscape Ltd
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2015 Mindscape Ltd
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,48 +1,49 @@
1
- # capistrano-raygun-deployment
2
-
3
- Capistrano Raygun Deployment makes it easy to notify Raygun of your deployments using a capistrano task.
4
-
5
- ## Installation
6
-
7
- First, install the gem:
8
-
9
- gem install capistrano-raygun-deployment
10
-
11
- Or if you are using Bundler, add it to your `Gemfile`:
12
-
13
- echo "gem 'capistrano-raygun-deployment'" >> Gemfile
14
- bundle install
15
-
16
- Then, add the following to your `Capfile`:
17
-
18
- require 'capistrano/raygun-deployment'
19
-
20
- Finally, add this configuration to your config:
21
-
22
- set :raygun_api_key, "YOUR_APPLICATIONS_API_KEY"
23
- set :raygun_auth_token, "YOUR_EXTERNAL_AUTH_TOKEN"
24
- set :raygun_release_path, "releases/LATEST" #optional, defaults to RELEASE
25
- set :use_git, false #optional, for if you don't want to send a git hash with your deployment
26
-
27
- You'll need the Raygun API Key for your application, plus an External Auth Token which you can generate [here](https://app.raygun.io/user).
28
-
29
- Finally, create a release file. We default to checking `RELEASE`, but you can change this by setting `:raygun_release_path`
30
- This is an example release file:
31
-
32
- version: 6.0.0
33
- ownerName: Jamie Penney
34
- emailAddress: jamie@example.com
35
- notes: |
36
- # Testing out the capistrano plugin
37
-
38
- * More markdown formatting
39
-
40
- ### Jamie
41
-
42
- Once you've written this to `RELEASE`, you can deploy with `cap deploy` and your deployment will be sent to Raygun!
43
-
44
- # Changelog
45
-
46
- * **1.1.0**: Use `after deploy:finished` instead of `after :published` so that deployments are only pushed to Raygun when things
47
- fully succeed.
48
- * **1.0.0**: Initial release
1
+ # capistrano-raygun-deployment
2
+
3
+ Capistrano Raygun Deployment makes it easy to notify Raygun of your deployments using a capistrano task.
4
+
5
+ ## Installation
6
+
7
+ First, install the gem:
8
+
9
+ gem install capistrano-raygun-deployment
10
+
11
+ Or if you are using Bundler, add it to your `Gemfile`:
12
+
13
+ echo "gem 'capistrano-raygun-deployment'" >> Gemfile
14
+ bundle install
15
+
16
+ Then, add the following to your `Capfile`:
17
+
18
+ require 'capistrano/raygun-deployment'
19
+
20
+ Finally, add this configuration to your config:
21
+
22
+ set :raygun_api_key, "YOUR_APPLICATIONS_API_KEY"
23
+ set :raygun_auth_token, "YOUR_EXTERNAL_AUTH_TOKEN"
24
+ set :raygun_release_path, "releases/LATEST" #optional, defaults to RELEASE
25
+ set :use_git, false #optional, for if you don't want to send a git hash with your deployment
26
+ set :raygun_scm_type, 'SCM Type' # must be one of GitLab, BitBucket or Github. Defaults to Github if not set
27
+
28
+ You'll need the Raygun API Key for your application, plus an External Auth Token which you can generate [here](https://app.raygun.io/user).
29
+
30
+ Finally, create a release file. We default to checking `RELEASE`, but you can change this by setting `:raygun_release_path`
31
+ This is an example release file:
32
+
33
+ version: 6.0.0
34
+ ownerName: Jamie Penney
35
+ emailAddress: jamie@example.com
36
+ notes: |
37
+ # Testing out the capistrano plugin
38
+
39
+ * More markdown formatting
40
+
41
+ ### Jamie
42
+
43
+ Once you've written this to `RELEASE`, you can deploy with `cap deploy` and your deployment will be sent to Raygun!
44
+
45
+ # Changelog
46
+
47
+ * **1.1.0**: Use `after deploy:finished` instead of `after :published` so that deployments are only pushed to Raygun when things
48
+ fully succeed.
49
+ * **1.0.0**: Initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -1,58 +1,58 @@
1
- require 'net/http'
2
- require 'yaml'
3
- require 'json'
4
-
5
- namespace :deploy do
6
- desc 'Registers a deployment with Raygun'
7
- task :raygun_register_deployment do
8
-
9
- if fetch(:raygun_api_key).nil?
10
- ask(:raygun_api_key, 'Required')
11
- end
12
- if fetch(:raygun_auth_token).nil?
13
- ask(:raygun_auth_token, 'Required')
14
- end
15
-
16
- run_locally do
17
-
18
- yaml = YAML::load_file(fetch(:raygun_release_path, 'RELEASE'))
19
-
20
- use_git = fetch(:scm) == :git && fetch(:use_git, true)
21
- git_hash = if use_git && system('git rev-parse --verify HEAD')
22
- `git rev-parse --verify HEAD`
23
- else
24
- ""
25
- end
26
-
27
- deployment = {
28
- 'apiKey' => fetch(:raygun_api_key),
29
- 'version' => yaml['version'],
30
- 'ownerName' => yaml['ownerName'],
31
- 'emailAddress' => yaml['emailAddress'],
32
- 'comment' => yaml['notes'],
33
- 'scmIdentifier' => git_hash,
34
- 'createdAt' => yaml['createdAt']
35
- }
36
-
37
- uri = URI.parse(fetch(:raygun_api_uri, "https://app.raygun.io"))
38
- deploymentEndpoint = "/deployments?authToken=#{fetch(:raygun_auth_token)}"
39
-
40
- http = Net::HTTP.new(uri.host, uri.port)
41
- http.use_ssl = fetch(:raygun_use_ssl, true)
42
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
43
- request = Net::HTTP::Post.new(deploymentEndpoint)
44
- request.add_field('Content-Type', 'application/json')
45
- request.body = deployment.to_json
46
- res = http.request(request)
47
- case res
48
- when Net::HTTPSuccess
49
- # OK
50
- info "Sent deployment to Raygun"
51
- else
52
- raise "Error sending deployment to Raygun: " + res.value
53
- end
54
- end
55
- end
56
- after 'deploy:finished', :raygun_register_deployment
57
-
58
- end
1
+ require 'net/http'
2
+ require 'yaml'
3
+ require 'json'
4
+
5
+ namespace :deploy do
6
+ desc 'Registers a deployment with Raygun'
7
+ task :raygun_register_deployment do
8
+
9
+ required_options = [:raygun_api_key, :raygun_auth_token]
10
+ required_options.each do |opt|
11
+ if fetch(opt).nil?
12
+ ask(opt, 'Required')
13
+ end
14
+ end
15
+
16
+ run_locally do
17
+ yaml = YAML::load_file(fetch(:raygun_release_path, 'RELEASE'))
18
+
19
+ use_git = fetch(:scm) == :git && fetch(:use_git, true)
20
+ git_hash = if use_git && system('git rev-parse --verify HEAD')
21
+ `git rev-parse --verify HEAD`
22
+ else
23
+ ""
24
+ end
25
+
26
+ deployment = {
27
+ 'apiKey' => fetch(:raygun_api_key),
28
+ 'version' => yaml['version'],
29
+ 'ownerName' => yaml['ownerName'],
30
+ 'emailAddress' => yaml['emailAddress'],
31
+ 'comment' => yaml['notes'],
32
+ 'scmIdentifier' => git_hash,
33
+ 'scmType' => fetch(:raygun_scm_type) || 'Github',
34
+ 'createdAt' => yaml['createdAt']
35
+ }
36
+
37
+ uri = URI.parse(fetch(:raygun_api_uri, "https://app.raygun.io"))
38
+ deploymentEndpoint = "/deployments?authToken=#{fetch(:raygun_auth_token)}"
39
+
40
+ http = Net::HTTP.new(uri.host, uri.port)
41
+ http.use_ssl = fetch(:raygun_use_ssl, true)
42
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
43
+ request = Net::HTTP::Post.new(deploymentEndpoint)
44
+ request.add_field('Content-Type', 'application/json')
45
+ request.body = deployment.to_json
46
+ res = http.request(request)
47
+ case res
48
+ when Net::HTTPSuccess
49
+ # OK
50
+ info "Sent deployment to Raygun"
51
+ else
52
+ raise "Error sending deployment to Raygun: " + res.value
53
+ end
54
+ end
55
+ end
56
+
57
+ after 'deploy:finished', :raygun_register_deployment
58
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-raygun-deployment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Penney
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-14 00:00:00.000000000 Z
12
+ date: 2017-11-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A capistrano task to notify Raygun.io of a deployment
15
15
  email: hello@raygun.io
@@ -33,17 +33,17 @@ require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ! '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ! '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 2.4.6
46
+ rubygems_version: 2.5.1
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Capistrano Raygun Deployment