bumperok 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bumper +8 -3
- data/lib/bumper.rb +4 -4
- 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: 191317a2c2af1287ada492de6cf8ea7e9aa414f6
|
4
|
+
data.tar.gz: e5fa07162bc94467af350e1804a05a60e7308790
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 728396fafb038ba1f106e220bd23302b33441a9aa1144e63c01d5780b3e036ebb68327d11e3bfed39a084455a5b18eae1171607ab284d2736381f0c5754021f0
|
7
|
+
data.tar.gz: d97112cc6510ea048cbe5bb3ad2d58b7dc8854ce28e90da4c94104b4f5eefa0472adc0522de549a6881f6d749318da2a5930026ccbc0b60d22b9d3018c63606d
|
data/bin/bumper
CHANGED
@@ -45,6 +45,11 @@ OptionParser.new do |opts|
|
|
45
45
|
options.endpoint = e
|
46
46
|
end
|
47
47
|
|
48
|
+
opts.on("-tTARGET_PROJECT_ID", "--target-project-id=TARGET_PROJECT_ID", "Project id for gitlab") do |p|
|
49
|
+
options.target_project_id = p
|
50
|
+
end
|
51
|
+
|
52
|
+
|
48
53
|
end.parse!
|
49
54
|
|
50
55
|
case options.cmd
|
@@ -63,11 +68,11 @@ when 'submodule'
|
|
63
68
|
Bumper.submodule_update_version("#{options.git_submodule[0].upcase}#{options.git_submodule[1..-1]}", options.git_submodule, options.git_url)
|
64
69
|
end
|
65
70
|
when 'merge'
|
66
|
-
if options.git_url and options.git_submodule and options.project_id
|
71
|
+
if options.git_url and options.git_submodule and options.project_id and options.target_project_id
|
67
72
|
if options.endpoint
|
68
|
-
Bumper.create_merge_request_from_submodule(options.git_submodule, options.git_url, options.project_id, options.key, options.endpoint)
|
73
|
+
Bumper.create_merge_request_from_submodule(options.git_submodule, options.git_url, options.project_id, options.target_project_id, options.key, options.endpoint)
|
69
74
|
else
|
70
|
-
Bumper.create_merge_request_from_submodule(options.git_submodule, options.git_url, options.project_id, options.key)
|
75
|
+
Bumper.create_merge_request_from_submodule(options.git_submodule, options.git_url, options.project_id, options.target_project_id, options.key)
|
71
76
|
end
|
72
77
|
end
|
73
78
|
else
|
data/lib/bumper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'jenkins_api_client'
|
|
5
5
|
require 'gitlab'
|
6
6
|
|
7
7
|
class Bumper
|
8
|
-
VERSION = "0.0.
|
8
|
+
VERSION = "0.0.11"
|
9
9
|
|
10
10
|
def self.tag git_path, tag_name
|
11
11
|
wrapper = GitSSHWrapper.with_wrapper(private_key_path: '~/.ssh/bumber_at_sibext', log_level: 'ERROR') do |w|
|
@@ -40,17 +40,17 @@ class Bumper
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
def self.create_merge_request_from_submodule submodule_name, git,
|
43
|
+
def self.create_merge_request_from_submodule submodule_name, git, from_project_id, to_project_id, gitlab_key, gitlab_url='http://src.sibext.com/api/v3'
|
44
44
|
Gitlab.endpoint=gitlab_url
|
45
45
|
Gitlab.private_token=gitlab_key
|
46
46
|
begin
|
47
|
-
merge = Gitlab.merge_requests(
|
47
|
+
merge = Gitlab.merge_requests(from_project_id).sort { |a,b| a.created_at <=> b.created_at }.last
|
48
48
|
rescue Gitlab::Error::NotFound => e
|
49
49
|
merge = nil
|
50
50
|
end
|
51
51
|
if merge
|
52
52
|
submodule_update_feature submodule_name, git, merge.source_branch
|
53
|
-
Gitlab.create_merge_request
|
53
|
+
Gitlab.create_merge_request to_project_id, merge.title, source_branch: merge.source_branch, target_branch: 'master'
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|