Class: BigKeeper::GitflowOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/big_keeper/util/gitflow_operator.rb

Overview

Operator for gitflow

Instance Method Summary collapse

Instance Method Details

#finish_release(path, release_name) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/big_keeper/util/gitflow_operator.rb', line 29

def finish_release(path, release_name)
  Dir.chdir(path) do
    p `git checkout master`
    p `git merge release/#{release_name}`
    p `git push`
    p `git checkout develop`
    p `git merge release/#{release_name}`
    p `git push`
    p `git branch -d release/#{release_name}`
  end
end

#init_git_flow(path) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/big_keeper/util/gitflow_operator.rb', line 14

def init_git_flow(path)
  Dir.chdir(path) do
    clear_flag = 'Already initialized for gitflow'
    IO.popen('git flow init -d') do |io|
      io.each do |line|
        if !line.include? clear_flag
          GitOperator.new.push(module_full_path, 'master') if !GitOperator.new.has_remote_branch(module_full_path, 'master')
          GitOperator.new.push(module_full_path, 'develop') if !GitOperator.new.has_remote_branch(module_full_path, 'develop')
          break
        end
      end
    end
  end
end

#start(path, name, type) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/big_keeper/util/gitflow_operator.rb', line 6

def start(path, name, type)
  init_git_flow(path)
  Dir.chdir(path) do
    gitflow_type_name = GitflowType.name(type)
    p `git flow #{gitflow_type_name} start #{name}`
  end
end