Class: Pindo::Command::Deploy::Quswark

Inherits:
Pindo::Command::Deploy show all
Includes:
Pindo::Command::DeployOptions
Defined in:
lib/pindo/command/deploy/quswark.rb

Constant Summary

Constants inherited from Pindo::Command

Pindo::Command::DEFAULT_OPTIONS, Pindo::Command::DEFAULT_ROOT_OPTIONS

Instance Attribute Summary

Attributes included from Pindo::Command::DeployOptions

#additional_args, #apple_id, #args_adhoc_flag, #args_appconfig, #args_appconfig_dir, #args_appconfig_fullname, #args_apple_id, #args_appstore_flag, #args_array, #args_bundle_id, #args_dev_flag, #args_repo_name, #argv_temp, #bundle_id, #bundle_id_extension, #bundle_id_extensionad, #bundle_id_extensionporn, #bundle_id_imessage, #bundle_id_keyboard, #bundle_id_pushcontent, #bundle_id_pushservice, #bundle_id_siri, #bundle_id_siriui, #bundle_id_watchapp, #bundle_id_watchapp_extension, #bundle_id_widget, #config_json, #deploy_acount_id, #deploy_group_id, #deploy_icloud_id, #deploy_identifier, #deploy_identifier_extension, #deploy_identifier_extensionad, #deploy_identifier_extensionporn, #deploy_identifier_imessage, #deploy_identifier_keyboard, #deploy_identifier_pushcontent, #deploy_identifier_pushservice, #deploy_identifier_siri, #deploy_identifier_siriui, #deploy_identifier_watchapp, #deploy_identifier_watchapp_extension, #deploy_identifier_widget, #deploy_repo_name, #group_id, #icloud_id, #newconfuse_flag, #oldconfuse_flag

Attributes inherited from Pindo::Command

#args_help_flag

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Pindo::Command::DeployOptions

#check_config_version, #get_build_type_args, #get_bundle_id_map, #get_confuse_type_args, #init_deploy_params, #init_develop_params, #print_params_info, #validate!

Methods inherited from Pindo::Command

run, #validate!

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

Methods included from Githelper

#add_branch, #add_tag, #add_tag_with_check, #clone_clang_repo, #clone_devclang_repo, #clone_pindo_common_config_repo, #clone_pindo_env_config_repo, #clong_buildconfig_repo, #get_repo_base_name, #getcode_to_dir, #git_addpush_repo, #git_latest_commit_id, #local_branch_exists?, #local_tag_exists?, #prepare_gitenv, #process_need_add_files, #remote_branch_exists?, #remote_tag_exists?, #remove_branch, #remove_tag

Methods included from Executable

capture_command, #executable, execute_command, which, which!

Constructor Details

#initialize(argv) ⇒ Quswark

Returns a new instance of Quswark.



31
32
33
34
# File 'lib/pindo/command/deploy/quswark.rb', line 31

def initialize(argv)
    super
    @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



25
26
27
28
29
# File 'lib/pindo/command/deploy/quswark.rb', line 25

def self.options
    [

    ].concat(super)
end

Instance Method Details

#quark_runObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/pindo/command/deploy/quswark.rb', line 103

def quark_run

    Pindo::Command::Env::Quarkenv::run([])

    new_project_dir = Dir.pwd
    
    quark_mode = 'prod'
    if @args_adhoc_flag || @args_dev_flag
        quark_mode = 'test'
    end
    command = 'quark host ' + quark_mode
    system command

    quark_json_file  = File.join(new_project_dir, "QuarkData/Quark.lock")
    quark_json = JSON.parse(File.read(quark_json_file))

    if @config_json && @config_json['app_setting'] && @config_json['app_setting']['app_client_url']
        quark_json['remote'] = File.join(@config_json['app_setting']['app_client_url'], 'api/init')
    end
    
    embed_name = "Meety.dat"
    category_name = "PodsDummy"
    if @config_json['project_info'] && @config_json['project_info']['project_name']
        category_name = @config_json['project_info']['project_name']
        category_name = category_name.gsub(/ /, '');
        category_name = category_name.gsub(/\'/, '');
        embed_name = category_name + ".dat"
    end
    quark_json['embed'] = embed_name
    quark_json['category'] = category_name
    quark_json['env'] = quark_mode
    
    File.open(quark_json_file, "w") do |file|
        file.write(JSON.pretty_generate(quark_json))
        file.close
    end

end

#runObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/pindo/command/deploy/quswark.rb', line 36

def run

    if @config_json['project_info']['xcode_build_type'] && @config_json["project_info"]["xcode_build_type"].include?("quark")
        quark_run
    elsif @config_json['project_info']['xcode_build_type'] && @config_json["project_info"]["xcode_build_type"].include?("swark")
        swark_run
    else
        swark_run
    end

end

#swark_runObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/pindo/command/deploy/quswark.rb', line 49

def swark_run

    Pindo::Command::Env::Swarkenv::run([])
    Pindo::Command::Deploy::Quswauth::run([])

    new_project_dir = Dir.pwd
    
    swark_host_name= File.join(new_project_dir, "Swark.host.yaml")
    host_json = {}

    host_json["remote"] = {}
    host_url = ""
    host_json["remote"]["test"] = ""

    if @config_json && @config_json['app_setting'] && @config_json['app_setting']['app_client_url']
        host_url = File.join(@config_json['app_setting']['app_client_url'], 'api/v3/init')
    end

    if @config_json && @config_json['app_setting'] && @config_json['app_setting']['kGUKeyAppClientHost']
        host_url = File.join(@config_json['app_setting']['kGUKeyAppClientHost'], 'api/v3/init')
    end

    host_json["remote"]["pre"] = host_url
    host_json["remote"]["prod"] = host_url
    

    embed_name = "vdisk.dat"
    category_name = "VMDemo"
    if @config_json['project_info'] && @config_json['project_info']['project_name']
        category_name = @config_json['project_info']['project_name']
        category_name = category_name.gsub(/ /, '');
        category_name = category_name.gsub(/\'/, '');
        embed_name = category_name + ".dat"
    end
    host_json["embed"] = embed_name

    yaml_to_save = File.open(swark_host_name,"w")
    YAML::dump(host_json,yaml_to_save)
    yaml_to_save.close

    
    swark_mode = 'prod'
    if @args_adhoc_flag || @args_dev_flag
        swark_mode = 'pre'
    end
    command = 'swark host ' + swark_mode

    # if @config_json['project_info']['xcode_build_type'] && @config_json["project_info"]["xcode_build_type"].include?("swark") && @config_json["project_info"]["xcode_build_type"].include?("confuse")
        # command = command + " --strip-compatibility-swift51"
    # end
    system command

end