Sha256: 0432c0fd30f134c5256938b6f782e98969244ec918c522e2a63dacdff141c269

Contents?: true

Size: 1.81 KB

Versions: 13

Compression:

Stored size: 1.81 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/model/operate_type'
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(modules, OperateType::PUBLISH, 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

13 entries across 13 versions & 2 rubygems

Version Path
kookeeper-3.0.0 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-2.0.0 lib/big_keeper/command/feature&hotfix/publish.rb
kookeeper-1.0.0 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.12 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.11 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.10 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.9 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.8 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.7 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.6 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.5 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.4 lib/big_keeper/command/feature&hotfix/publish.rb
bigkeeper-0.9.3 lib/big_keeper/command/feature&hotfix/publish.rb