Class: Dean::Cli::Application

Inherits:
Thor
  • Object
show all
Defined in:
lib/dean/cli.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



24
25
26
27
28
29
30
31
# File 'lib/dean/cli.rb', line 24

def build()
  begin
    Dean::Build.new.build_all_environments
  rescue Exception => e
    log_exception e
  end

end

#bump(value, name = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dean/cli.rb', line 8

def bump(value, name=nil)
  plists = []
  Dean::ConfigurationHelper.new.all_environments.each do |environment|
    plists.push environment[:plist]
  end
  old_version = Dean::ProjectVersionHelper.new.version_from_plist plists[0]

  Dean::VersionBumper.new.bump_all_environments value.to_sym, name

  # commit and tag, here only for the moment!
  new_version = Dean::ProjectVersionHelper.new.version_from_plist plists[0]
  message = "Do you want to commit the changes to the version (#{old_version} -> #{new_version})?"
  Dean::GitHelper.new.commit_asking_user(message, new_version, plists)
end

#deploy(environment_name = nil) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/dean/cli.rb', line 39

def deploy(environment_name=nil)
  Dean::ConfigurationHelper.new.all_environments.each do |environment|
    if environment_name != nil
      if environment_name == environment[:name]
        begin
          Dean::Build.new.build_environment environment
          Dean::Upload.new.upload_environment environment
        rescue Exception => e
          log_exception e
        end
      end
    else
      begin
        Dean::Build.new.build_environment environment
        Dean::Upload.new.upload_environment environment
      rescue Exception => e
        log_exception e
      end
    end
  end
end

#distributeObject



34
35
36
# File 'lib/dean/cli.rb', line 34

def distribute()
  Dean::Upload.new.upload_all_environments
end