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 +4 -4
- data/README.md +1 -0
- data/lib/capistrano/github/releases/version.rb +1 -1
- data/lib/capistrano/tasks/github_releases.rake +18 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a67898c1082322f4b4f8c7dcdd603d2f3f19a17
|
4
|
+
data.tar.gz: 00d7d5cc3f6db51112cdb1e73298e59f258fc92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -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
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
50
|
-
|
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
|