relsr 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relsr/initializer.rb +4 -4
- data/lib/relsr/release_manager.rb +32 -20
- data/lib/relsr/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 573c8fedcc92906cd34469ffa7023636abf3e6b4
|
4
|
+
data.tar.gz: ee9b2213e2fcd3373efa59f810615f60cbbf35f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be4e56435ddc5002ee418ea55416eee091227ec1ce8f194bce21557d0ce42dcec188ecab54e626e09647c5bac3c2afe7118ec0a41902171c8773a560e2740c78
|
7
|
+
data.tar.gz: 13ed7e2e54734ddf2cccf46fd19d21863ba6631a048bd8f61a3c2279861e5d2c5aebd292e4b9a89bf4fc0efc2d2a3880b4d054030c03bde6ccdd8b99f4e3c86d
|
data/lib/relsr/initializer.rb
CHANGED
@@ -4,7 +4,7 @@ require 'optparse'
|
|
4
4
|
module Relsr
|
5
5
|
class Initializer
|
6
6
|
|
7
|
-
YAML_FILE = 'relsr.yml'
|
7
|
+
YAML_FILE = '.relsr.yml'
|
8
8
|
|
9
9
|
def self.init
|
10
10
|
parse_options
|
@@ -32,7 +32,7 @@ module Relsr
|
|
32
32
|
@options[:dry_run] = true
|
33
33
|
end
|
34
34
|
|
35
|
-
opts.on("-i", "--init", "Create
|
35
|
+
opts.on("-i", "--init", "Create #{YAML_FILE} for project") do |v|
|
36
36
|
create_default_yaml
|
37
37
|
exit 0
|
38
38
|
end
|
@@ -41,7 +41,7 @@ module Relsr
|
|
41
41
|
|
42
42
|
def self.parse_yaml
|
43
43
|
unless File.exists?(YAML_FILE)
|
44
|
-
puts
|
44
|
+
puts "Could not file #{YAML_FILE} file."
|
45
45
|
exit 1
|
46
46
|
end
|
47
47
|
begin
|
@@ -51,7 +51,7 @@ module Relsr
|
|
51
51
|
@repo = config['repo']
|
52
52
|
@label = config['label']
|
53
53
|
rescue StandardError => error
|
54
|
-
puts
|
54
|
+
puts "invalid #{YAML_FILE} file"
|
55
55
|
puts error.message
|
56
56
|
exit 1
|
57
57
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'octokit'
|
2
|
+
require 'colorize'
|
2
3
|
|
3
4
|
module Relsr
|
4
5
|
class ReleaseManager
|
@@ -17,35 +18,42 @@ module Relsr
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def create_pull_request
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
print_and_flush "Creating Pull Request..."
|
22
|
+
unless @dry_run
|
23
|
+
client.create_pull_request(
|
24
|
+
@repo_name,
|
25
|
+
'master',
|
26
|
+
@release_branch_name,
|
27
|
+
@release_branch_name,
|
28
|
+
pr_body
|
29
|
+
)
|
30
|
+
|
31
|
+
end
|
32
|
+
puts 'done'.green
|
29
33
|
end
|
30
34
|
|
31
35
|
private
|
32
36
|
|
33
37
|
def create_release_branch
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
print_and_flush "Creating release branch '#{@release_branch_name}' on '#{@repo_name}'..."
|
39
|
+
unless @dry_run
|
40
|
+
client.create_ref(@repo_name, "heads/#{@release_branch_name}", master.object.sha)
|
41
|
+
end
|
42
|
+
puts 'done'.green
|
37
43
|
end
|
38
44
|
|
39
45
|
def merge_work_branches
|
40
46
|
branches_to_merge.each do |work_branch|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
print_and_flush "Merging '#{work_branch}' into release..."
|
48
|
+
unless @dry_run
|
49
|
+
client.merge(
|
50
|
+
@repo_name,
|
51
|
+
@release_branch_name,
|
52
|
+
work_branch,
|
53
|
+
commit_message: "Merging #{work_branch} into release"
|
54
|
+
)
|
55
|
+
end
|
56
|
+
puts 'done'.green
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
@@ -88,5 +96,9 @@ module Relsr
|
|
88
96
|
end.join("\n")
|
89
97
|
end
|
90
98
|
|
99
|
+
def print_and_flush(msg)
|
100
|
+
print msg
|
101
|
+
STDOUT.flush
|
102
|
+
end
|
91
103
|
end
|
92
104
|
end
|
data/lib/relsr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relsr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Cleary
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colorize
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description:
|
42
56
|
email:
|
43
57
|
- john@createk.io
|