Class: Phase::CLI::IPA

Inherits:
Command show all
Defined in:
lib/phase/cli/ipa.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#args, #options

Instance Method Summary collapse

Methods included from Util::Console

#ask, #fail, #log

Constructor Details

#initialize(args, options) ⇒ IPA

Returns a new instance of IPA.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/phase/cli/ipa.rb', line 23

def initialize(args, options)
  @version   = args.shift
  @filenames = args

  if @version.blank? || @filenames.blank?
    fail "invalid syntax: phase ipa [-e environment] version_number filename|glob_pattern..."
  end

  if Phase.config.ipa.bundle_id_prefix.blank?
    fail "missing setting: set `Phase.config.ipa.bundle_id_prefix = [PREFIX] in Phasefile"
  elsif Phase.config.ipa.bucket_name.blank?
    fail "missing setting: set `Phase.config.ipa.bucket_name = [BUCKET]` in Phasefile"
  elsif Phase.config.ipa.directory_prefix.blank?
    fail "missing setting: set `Phase.config.ipa.directory_prefix = [PREFIX] in Phasefile"
  end

  super
end

Instance Attribute Details

#filenamesObject

Returns the value of attribute filenames.



21
22
23
# File 'lib/phase/cli/ipa.rb', line 21

def filenames
  @filenames
end

#versionObject

Returns the value of attribute version.



21
22
23
# File 'lib/phase/cli/ipa.rb', line 21

def version
  @version
end

Instance Method Details

#runObject



42
43
44
45
# File 'lib/phase/cli/ipa.rb', line 42

def run
  deployment = ::Phase::IPA::EnterpriseDeployment.new(options.environment, version, *filenames)
  deployment.run!
end