Sha256: a2c37f6b67daf2b89c8e7de1acfa36a43ba3fddd6c6b8c02fe34accab3f38a46

Contents?: true

Size: 1.74 KB

Versions: 23

Compression:

Stored size: 1.74 KB

Contents

#!/usr/bin/ruby

require 'big_keeper/util/podfile_operator'
require 'big_keeper/util/logger'
require 'big_keeper/util/pod_operator'
require 'big_keeper/util/xcode_operator'
require 'big_keeper/util/cache_operator'
require 'big_keeper/util/bigkeeper_parser'

require 'big_keeper/dependency/dep_service'

require 'big_keeper/dependency/dep_type'


module BigKeeper

  def self.publish(path, user, type)
    begin
      # Parse Bigkeeper file
      BigkeeperParser.parse("#{path}/Bigkeeper")

      branch_name = GitOperator.new.current_branch(path)
      Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)

      path_modules = ModuleCacheOperator.new(path).current_path_modules
      Logger.error("You have unfinished modules #{path_modules}, Use 'finish' first please.") unless path_modules.empty?

      # Push modules changes to remote then rebase
      modules = ModuleCacheOperator.new(path).current_git_modules
      modules.each do |module_name|
        ModuleService.new.pre_publish(path, user, module_name, branch_name, type)
      end

      # Install
      DepService.dep_operator(path, user).install(false)

      # Modify module as git
      modules.each do |module_name|
        ModuleService.new.publish(path, user, module_name, branch_name, type)
      end

      Logger.highlight("Publish branch '#{branch_name}' for 'Home'")

      # Recover home
      DepService.dep_operator(path, user).recover

      # Push home changes to remote
      GitService.new.verify_push(path, "publish branch #{branch_name}", branch_name, 'Home')
      # Rebase Home
      GitService.new.verify_rebase(path, GitflowType.base_branch(type), 'Home')

      `open #{BigkeeperParser.home_pulls()}`
    ensure
    end
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
shkeeper-1.0.0 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.1.2 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.1.0 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.9 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.8 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.7 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.6 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.5 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.4 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-3.0.3 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.2 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.1 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.0 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.9 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.8 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.7 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.6 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.5 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.4 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.8.3 lib/big_keeper/command/feature&hotfix/publish.rb