Class: MSPRelease::CLI::Push

Inherits:
Command
  • Object
show all
Includes:
WorkingCopyCommand
Defined in:
lib/msp_release/cli/push.rb

Constant Summary

Constants included from Helpers

Helpers::PROJECT_FILE

Instance Attribute Summary

Attributes included from WorkingCopyCommand

#git, #project

Instance Method Summary collapse

Methods included from WorkingCopyCommand

#initialize

Methods included from Helpers

#author, #changelog, #data, #data=, #data_exists?, #fail_if_modified_wc, #fail_if_push_pending, #git_version, #load_data, #msp_version, #on_release_branch?, #remove_data, #save_data, #time, #time_rfc, #timestamp

Methods included from Exec::Helpers

#exec

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/msp_release/cli/push.rb', line 8

def run
  unless data_exists?
    raise CLI::Exit, "You need to stage a new release before you can push it"
  end

  load_data
  release_name = "#{data[:version]}"
  tagname = "release-#{release_name}"

  if project.respond_to?(:project_specific_push)
    project.project_specific_push(release_name)
  end

  exec "git tag #{tagname}"
  exec "git push origin #{git.cur_branch}"
  stdout.puts "Pushing new release tag: #{tagname}"
  exec "git push origin #{tagname}"

  remove_data
end