github-release-party 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/github-release-party/tasks/heroku.rb +90 -72
- data/lib/github-release-party/version.rb +1 -1
- metadata +22 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 004e473ce8b4be868b8dfc3e6d9d077a22225ae0
|
4
|
+
data.tar.gz: 61404a8f2907d6974e656282b532ed24138cdd96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 368ca7b60b996e354506f3671021b24a0b009d7a96d66f2cd664b90d28b83f4dcc0101feb66390e522e8984655bea0b503543d1dd09b5bfc943051270b346f6b
|
7
|
+
data.tar.gz: 15d9d75e979947714cbc289686b01702352f4c9a4f95af7bf6cf4f59f2ff96244693ecb4c9beb00e6fc87ec551b5fbb48cf3898e106efda90d63d81322f4d543
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -1,102 +1,120 @@
|
|
1
|
+
require "open3"
|
1
2
|
require "github-release-party"
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def heroku_push(args=[])
|
5
|
+
# grab the new version number from the Heroku push output
|
6
|
+
cmd = %w[git push heroku HEAD:master] + args
|
7
|
+
ver = Open3.popen2e(*cmd) do |stdin, output, thread|
|
8
|
+
v = nil
|
9
|
+
output.each do |line|
|
10
|
+
puts line
|
11
|
+
if /Released (v\d+)/ =~ line
|
12
|
+
v = $~[1]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
v
|
9
16
|
end
|
10
|
-
|
17
|
+
return ver
|
18
|
+
end
|
19
|
+
|
20
|
+
def github_tag(hash, ver)
|
21
|
+
# build tag message
|
22
|
+
repo = GithubReleaseParty.repo
|
23
|
+
tag_name = "heroku/#{ver}"
|
24
|
+
last_tag = `git describe --tags --abbrev=0 --match 'heroku/v*' 2> /dev/null`.strip
|
25
|
+
if last_tag.empty?
|
26
|
+
# first deploy, use root hash
|
27
|
+
last_tag = `git rev-list --max-parents=0 HEAD`.strip[0..6]
|
28
|
+
first_deploy = true
|
29
|
+
end
|
30
|
+
commits = `git log #{last_tag}..#{hash} --pretty=format:"- [%s](https://github.com/#{repo}/commit/%H)"`
|
31
|
+
message = "Deploy #{hash[0..6]}\n\nDiff: https://github.com/#{repo}/compare/#{last_tag}...#{tag_name}\n#{commits}"
|
32
|
+
|
33
|
+
if first_deploy
|
34
|
+
message = "#{message.strip}\n"+`git show #{last_tag} -s --pretty=format:"- [%s](https://github.com/#{repo}/commit/%H)"`
|
35
|
+
end
|
36
|
+
|
37
|
+
# tag and push new tag
|
38
|
+
puts "Tagging #{tag_name}."
|
39
|
+
success = system "git tag -a -m \"#{message.gsub('"','\\"')}\" #{tag_name} #{hash}"
|
40
|
+
abort if not success
|
41
|
+
success = system "git push origin #{tag_name}"
|
42
|
+
abort if not success
|
43
|
+
|
44
|
+
# create GitHub release
|
45
|
+
puts
|
46
|
+
puts "Waiting 3 seconds to let GitHub process the new tag."
|
47
|
+
sleep 3
|
48
|
+
GithubReleaseParty.create(tag_name, ver, message)
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
desc "Deploy a new version to Heroku"
|
53
|
+
task :deploy do
|
54
|
+
abort if not GithubReleaseParty.env_ok
|
55
|
+
ver = heroku_push() or abort("Deploy failed.")
|
56
|
+
hash = `git rev-parse HEAD`.strip
|
57
|
+
github_tag(hash, ver)
|
11
58
|
end
|
12
59
|
|
13
60
|
namespace :deploy do
|
14
|
-
desc "
|
61
|
+
desc "Deploy a new version to Heroku using --force"
|
15
62
|
task :force do
|
16
|
-
abort
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
Rake.application.invoke_task("deploy:tag")
|
63
|
+
abort if not GithubReleaseParty.env_ok
|
64
|
+
ver = heroku_push(%w[--force]) or abort("Deploy failed.")
|
65
|
+
hash = `git rev-parse HEAD`.strip
|
66
|
+
github_tag(hash, ver)
|
22
67
|
end
|
23
68
|
|
24
|
-
desc "Tag
|
69
|
+
desc "Tag last release"
|
25
70
|
task :tag do
|
26
|
-
abort
|
71
|
+
abort if not GithubReleaseParty.env_ok
|
27
72
|
|
28
73
|
# get heroku version number
|
29
74
|
begin
|
30
75
|
heroku_app = `git remote -v`.scan(/^heroku\t.*heroku\.com[:\/](.+)\.git /).uniq.flatten.first
|
31
76
|
ver = `heroku releases --app '#{heroku_app}'`.split("\n")[1].split(" ")[0]
|
32
77
|
hash = `git rev-parse HEAD`.strip
|
33
|
-
tag_name = "heroku/#{ver}"
|
34
78
|
rescue
|
35
79
|
abort "There was a problem getting the release number. Have you logged in with the Heroku cli? Try again with 'rake deploy:tag'."
|
36
80
|
end
|
37
81
|
|
38
|
-
|
82
|
+
github_tag(hash, ver)
|
83
|
+
end
|
84
|
+
|
85
|
+
desc "Rebuild all the release tags"
|
86
|
+
task :retag do
|
87
|
+
github = GithubReleaseParty.new
|
39
88
|
repo = GithubReleaseParty.repo
|
40
|
-
last_tag = `git describe --tags --abbrev=0 --match 'heroku/v*' 2> /dev/null`.strip
|
41
|
-
if last_tag.empty?
|
42
|
-
# first deploy, use root hash
|
43
|
-
last_tag = `git rev-list --max-parents=0 HEAD`.strip[0..6]
|
44
|
-
first_deploy = true
|
45
|
-
end
|
46
|
-
commits = `git log #{last_tag}..#{hash} --pretty=format:"- [%s](https://github.com/#{repo}/commit/%H)"`
|
47
|
-
message = "Deploy #{hash[0..6]}\n\nDiff: https://github.com/#{repo}/compare/#{last_tag}...#{tag_name}\n#{commits}"
|
48
89
|
|
49
|
-
|
50
|
-
|
51
|
-
|
90
|
+
tags = `git tag -l heroku/v* --sort=version:refname`.split("\n")
|
91
|
+
puts "Found #{tags.count} tags."
|
92
|
+
tags.each_with_index do |tag_name, i|
|
93
|
+
ver = tag_name[/v(\d+)/]
|
94
|
+
last_tag = if i == 0
|
95
|
+
`git rev-list --max-parents=0 HEAD`.strip
|
96
|
+
else
|
97
|
+
tags[i-1]
|
98
|
+
end
|
52
99
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
success = system "git push origin #{tag_name}"
|
58
|
-
abort if not success
|
59
|
-
|
60
|
-
# create GitHub release
|
61
|
-
puts
|
62
|
-
puts "Waiting 3 seconds to let GitHub process the new tag."
|
63
|
-
sleep 3
|
64
|
-
GithubReleaseParty.create(tag_name, ver, message)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
desc "Rebuild all the release tags"
|
69
|
-
task :retag do
|
70
|
-
github = GithubReleaseParty.new
|
71
|
-
repo = GithubReleaseParty.repo
|
100
|
+
hash = `git rev-list --max-count=1 #{tag_name}`.strip
|
101
|
+
date = `git show --pretty="format:%ai" -s --no-color #{tag_name} | tail -1`.strip
|
102
|
+
commits = `git log #{last_tag}..#{tag_name} --pretty=format:"- [%s](https://github.com/#{repo}/commit/%H)"`
|
103
|
+
message = "Deploy #{hash[0..6]}\n\nDiff: https://github.com/#{repo}/compare/#{last_tag}...#{tag_name}\n#{commits}"
|
72
104
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
ver = tag_name[/v(\d+)/]
|
77
|
-
last_tag = if i == 0
|
78
|
-
`git rev-list --max-parents=0 HEAD`.strip
|
79
|
-
else
|
80
|
-
tags[i-1]
|
81
|
-
end
|
105
|
+
if i == 0
|
106
|
+
message += "\n"+`git show #{last_tag} -s --pretty=format:"- [%s](https://github.com/#{repo}/commit/%H)"`
|
107
|
+
end
|
82
108
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
109
|
+
success = system "GIT_COMMITTER_DATE='#{date}' git tag -f -a -m \"#{message.gsub('"','\\"')}\" #{tag_name} #{tag_name}^{}"
|
110
|
+
abort if not success
|
111
|
+
success = system "git push -f origin #{tag_name}"
|
112
|
+
abort if not success
|
87
113
|
|
88
|
-
|
89
|
-
|
114
|
+
# update or create GitHub release
|
115
|
+
github.update_or_create(tag_name, ver, message)
|
90
116
|
end
|
91
117
|
|
92
|
-
|
93
|
-
abort if not success
|
94
|
-
success = system "git push -f origin #{tag_name}"
|
95
|
-
abort if not success
|
96
|
-
|
97
|
-
# update or create GitHub release
|
98
|
-
github.update_or_create(tag_name, ver, message)
|
118
|
+
puts "Done"
|
99
119
|
end
|
100
|
-
|
101
|
-
puts "Done"
|
102
120
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-release-party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Sundin
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMREwDwYDVQQDDAhydWJ5
|
14
14
|
Z2VtczEcMBoGCgmSJomT8ixkARkWDHN0ZWZhbnN1bmRpbjETMBEGCgmSJomT8ixk
|
15
|
-
|
15
|
+
ARkWA2NvbTAeFw0xNjEyMjUwNjE1MjVaFw0yNjEyMjMwNjE1MjVaMEYxETAPBgNV
|
16
16
|
BAMMCHJ1YnlnZW1zMRwwGgYKCZImiZPyLGQBGRYMc3RlZmFuc3VuZGluMRMwEQYK
|
17
17
|
CZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
w1R+aqbSeZjouJP4SvaMtqaJCMnJzpKo4JY6DL/nkqLxfi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date: 2016-
|
34
|
+
date: 2016-12-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: httparty
|
@@ -51,16 +51,16 @@ dependencies:
|
|
51
51
|
name: rake
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
56
|
+
version: '12'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "
|
61
|
+
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: '12'
|
64
64
|
description: I use this gem to automatically create GitHub releases when I deploy
|
65
65
|
to Heroku. See the GitHub page for usage.
|
66
66
|
email:
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: 1.3.6
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.5.
|
95
|
+
rubygems_version: 2.5.2
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Easily create GitHub releases.
|
metadata.gz.sig
CHANGED
Binary file
|