bumperok 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bumper +8 -3
  3. data/lib/bumper.rb +4 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a3f09aa044e1b288cb6eef67f7b589722d0cd7
4
- data.tar.gz: e920b1996de34603d56fb40e30ffa391e03e4999
3
+ metadata.gz: 191317a2c2af1287ada492de6cf8ea7e9aa414f6
4
+ data.tar.gz: e5fa07162bc94467af350e1804a05a60e7308790
5
5
  SHA512:
6
- metadata.gz: 76e66bcb9cc1f5cd5d853f9b71ae98b9ae124f172d98659242a310f1e7155228cb7865d8db577c5c048cf5a3e1bcb2c4d569357e0289763fd96ed0a449c06969
7
- data.tar.gz: a97f8754e11e231fb7a17408087f3edab04742fdfb45291a7c2f1ffffd8dcdae8af13dcd891daac95918ea588710806145b4fe8907bb2ef79623495be7f2fa5b
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.10"
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, gitlab_project_id, gitlab_key, gitlab_url='http://src.sibext.com/api/v3'
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(gitlab_project_id).sort { |a,b| a.created_at <=> b.created_at }.last
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 gitlab_project_id, merge.title, source_branch: merge.source_branch, target_branch: 'master'
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumperok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolay Moskvin