capistrano-github-releases 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdfdbbaff66c661aab63db1a10214eb9d980c4f1
4
- data.tar.gz: 0da7a3da1b46da99ff4d8b2d08eb8632215f40ad
3
+ metadata.gz: 7a67898c1082322f4b4f8c7dcdd603d2f3f19a17
4
+ data.tar.gz: 00d7d5cc3f6db51112cdb1e73298e59f258fc92d
5
5
  SHA512:
6
- metadata.gz: b1537e033fe1c31f36557b0c2e69a403db158618d1688c1e2f0f70c3b027cd013cb89fccd4c440f6dffb09e3aca98bd39cc580efbab8b1513273f4ba95c9c809
7
- data.tar.gz: 951ced757101300eaf29b8b2a08cb6b9cd88d2bfd7abf2f78e8e62b051e05a1d467a6d3ccf786a158c043031cc7aa60331f514bd3137fde1a628cfe4ebadfb5f
6
+ metadata.gz: 60e71ae943e15ed7b3f932aaa7249380a8857b9b8797cbd76d90e04c2a7391e47bff69d090d350a5ecaf5e52449e0f09daa49a65317a5bf129d523ed099475be
7
+ data.tar.gz: 7d82df70535ad4985d768613ef9c21d9a3aff6a1f35304b41b29144c5d64b90abab4a45dcebdd161ee4e78ff09b1c6d58e38803130c84ead893ba91444bc1087
data/README.md CHANGED
@@ -54,6 +54,7 @@ Set capistrano variables with `set name, value`.
54
54
 
55
55
  Name | Default | Description
56
56
  ---- | ------- | -----------
57
+ ask_release | false | When true, asks for the release title and text
57
58
  release_tag | `Time.now.strftime('release-%Y%m%d-%H%M')` | Create releases when git-tag name
58
59
  release_comment | This change was deployed to production :octocat: ... | Pull requests to deploy report comment
59
60
 
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Github
3
3
  module Releases
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
6
6
  end
7
7
  end
@@ -16,16 +16,15 @@ end
16
16
 
17
17
  namespace :github do
18
18
  namespace :releases do
19
+ set :ask_release, false
20
+ set :release_tag, -> { Time.now.strftime('release-%Y%m%d-%H%M') }
21
+
19
22
  set :username, -> {
20
23
  username = `git config --get user.name`.strip
21
24
  username = `whoami`.strip unless username
22
25
  username
23
26
  }
24
27
 
25
- set :release_tag, -> {
26
- Time.now.strftime('release-%Y%m%d-%H%M')
27
- }
28
-
29
28
  set :release_title, -> {
30
29
  default_title = nil
31
30
 
@@ -39,15 +38,24 @@ namespace :github do
39
38
  end
40
39
  end
41
40
 
42
- title = HighLine.new.ask("Release Title? [default: #{default_title}]")
43
- title = default_title if title.empty?
44
- title
41
+ if fetch(:ask_release)
42
+ title = HighLine.new.ask("Release Title? [default: #{default_title}]")
43
+ title = default_title if title.empty?
44
+ title
45
+ else
46
+ default_title
47
+ end
45
48
  }
46
49
 
47
50
  set :release_body, -> {
48
51
  pull_req = "pull request: #{fetch(:github_repo)}##{fetch(:pull_request_id)}"
49
- body = HighLine.new.ask("Release Comment? [default: #{pull_req}]")
50
- "#{body + "\n" unless body.empty?}#{pull_req}"
52
+
53
+ if fetch(:ask_release)
54
+ body = HighLine.new.ask("Release Comment? [default: #{pull_req}]")
55
+ "#{body + "\n" unless body.empty?}#{pull_req}"
56
+ else
57
+ pull_req
58
+ end
51
59
  }
52
60
 
53
61
  set :pull_request_id, -> {
@@ -96,7 +104,7 @@ namespace :github do
96
104
  c.access_token = fetch(:github_token)
97
105
  end
98
106
 
99
- rate_limit = Octokit.rate_limit
107
+ rate_limit = Octokit.rate_limit!
100
108
  info 'Exceeded limit of the GitHub API request' if rate_limit.remaining.zero?
101
109
  debug "#{rate_limit}"
102
110
  rescue Octokit::NotFound
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-github-releases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - linyows