bumperok 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bumper.rb +16 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd51fec075c5a221ac72f2ac49c1a5f645f1df98
4
- data.tar.gz: f0d0fb2771667275f54375fb7fdfaddd91083663
3
+ metadata.gz: 228769945ea6cb431bb0315cc706d4278a924523
4
+ data.tar.gz: e525e97fc5556f3c4e9fae63e290af5837a8022a
5
5
  SHA512:
6
- metadata.gz: 6f0385b1c312ee32a7b382f2e515b00bb7f00852bbf25a3a70d64e206bd09c6f5f327f25ffa46f745cdc4d878aaf739e82aa673824fcf77082a0ed93e789b382
7
- data.tar.gz: 1caaa21255fe078f449b5381f2d1db471369004d86aea0b5c99b5b299b524dc88ca8eda787219ecce2485146412ee108ad5dda6e720fe49c04078197abf67bbf
6
+ metadata.gz: 088da4e585d4f6b64342db0a86b2e8a8584bfddeb4c66462ac8c4f01e9720a4f31c4073c37dc5bd7326311596da37a9d794f48cee5a148e5565b2d018ab1d84f
7
+ data.tar.gz: d4941c3cc17e5d6e615dd3dab87acd4b9330116a55a3704e91131fd1b54231aedf71b7979fa1557b8eea3d31e28b556d3695c50b90270459dd7f82010e559488
data/lib/bumper.rb CHANGED
@@ -4,13 +4,13 @@ require 'git-ssh-wrapper'
4
4
  require 'jenkins_api_client'
5
5
 
6
6
  class Bumper
7
- VERSION = "0.0.4"
7
+ VERSION = "0.0.5"
8
8
 
9
9
  def self.tag git_path, tag_name
10
10
  wrapper = GitSSHWrapper.with_wrapper(private_key_path: '~/.ssh/bumber_at_sibext', log_level: 'ERROR') do |w|
11
11
  w.set_env
12
- `git '--git-dir=#{git_path}/.git' '--work-tree=#{git_path}' tag '-f' '#{tag_name}' '-m tagged by Bumber'` # 2>&1
13
- `git '--git-dir=#{git_path}/.git' '--work-tree=#{git_path}' push '--force' 'origin' 'refs/tags/#{tag_name}'`
12
+ `#{git(git_path)} tag '-f' '#{tag_name}' '-m tagged by Bumber'` # 2>&1
13
+ `#{git(git_path)} push '--force' 'origin' 'refs/tags/#{tag_name}'`
14
14
  end
15
15
  end
16
16
 
@@ -25,16 +25,22 @@ class Bumper
25
25
  end
26
26
 
27
27
  def self.submodule_update_version display, name, git
28
+ project_path = 'git_with_submodule'
28
29
  wrapper = GitSSHWrapper.with_wrapper(private_key_path: '~/.ssh/bumber_at_sibext', log_level: 'ERROR') do |w|
29
30
  w.set_env
30
- `rm -Rf git_with_submodule`
31
- `git clone --recursive #{git} git_with_submodule`
32
- `git submodule update --remote #{name} --work-tree=git_with_submodule`
33
- `git checkout -b UpdateFrom#{display} --work-tree=git_with_submodule`
34
- `git commit -am'New updates from #{display}' --work-tree=git_with_submodule`
35
- `git push -f origin UpdateFrom#{display} --work-tree=git_with_submodule`
36
- `git branch -D UpdateFrom#{display} --work-tree=git_with_submodule`
31
+ `rm -Rf #{project_path}`
32
+ `git clone --recursive #{git} #{project_path}`
33
+ `#{git(project_path)} submodule update --remote #{name}`
34
+ `#{git(project_path)} checkout -b UpdateFrom#{display}`
35
+ `#{git(project_path)} commit -am'New updates from #{display}'`
36
+ `#{git(project_path)} push --force origin UpdateFrom#{display}`
37
+ `#{git(project_path)} branch -D UpdateFrom#{display}`
37
38
  end
38
39
 
39
40
  end
41
+
42
+ def self.git git_path
43
+ "git '--git-dir=#{git_path}/.git' '--work-tree=#{git_path}'"
44
+ end
45
+
40
46
  end
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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolay Moskvin