Class: AppSendr::Command::Deploy

Inherits:
Build
  • Object
show all
Defined in:
lib/appsendr/commands/deploy.rb

Overview

Inherhits from Deploy

Instance Attribute Summary

Attributes inherited from Build

#app_dir, #app_path, #configuration, #ipa_path, #provisioning_name, #provisioning_path

Attributes inherited from Base

#args, #autodetected_app

Instance Method Summary collapse

Methods inherited from Build

#clean

Methods inherited from Base

#appsendr, #ask, #confirm, #extract_app, #extract_option, #format_date, #initialize, #option_exists?

Methods included from Helpers

#credentials_file, #credentials_setup?, #display, #error, #has_project_droppr?, #home_directory, #in_project_dir?, #is_file_to_large?, #message, #project_appsendr, #project_appsendr_app, #read_app, #read_app_id, #require_in_project_and_no_droppr, #require_project, #require_project_dir, #require_project_droppr, #running_on_a_mac?, #running_on_windows?, #size_of_file

Constructor Details

This class inherits a constructor from AppSendr::Command::Base

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/appsendr/commands/deploy.rb', line 6

def index
    # 
    # opts = OptionParser.new 
    # opts.on('-m', '--message')    { output_version ; exit 0 }
    # 
    # opts.parse!(args) rescue return false
    #       
    #       
    notify = option_exists?('--notify', false)
    is_public = option_exists?('--public', false)
    
    @configuration = load_configuration          
    if require_project(1,"deploy","your active configuration name",true)
        
        @app_dir = path_to_app_dir
        @app_path = @app_dir+"/#{app_name}"
        if @app_name
            
            @notes = ask_for_notes
            message "Deploying #{@app_name}"    
            
            message "Building IPA File"    

            @ipa_path = build_ipa_with_app_at_path                  
            info = app_info              
            bundle_identifier ||= info['CFBundleIdentifier']
            icon_path = icon_path(info)
            if is_file_to_large?(@ipa_path)
                upload_large_ipa(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
            else
                message "Uploading IPA"
                appsendr.upload(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
                message "App deployed"
                
            end
            FileUtils.rm_rf @ipa_path
        else
            error "No .app file was built for the configuration \"#{@configuration}\". Compile your app or use the \"build\" command."
        end
    end
end