Class: Pindo::Command::Utils::Renewcert
- Inherits:
-
Pindo::Command::Utils
- Object
- CLAide::Command
- Pindo::Command
- Pindo::Command::Utils
- Pindo::Command::Utils::Renewcert
- Includes:
- Appselect, XcodeCertHelper
- Defined in:
- lib/pindo/command/utils/renewcert.rb
Constant Summary
Constants inherited from Pindo::Command
DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS
Instance Attribute Summary
Attributes inherited from Pindo::Command
Class Method Summary collapse
Instance Method Summary collapse
- #fixed_cert(bundle_id: nil, renew_flag: false, upload_flag: false, fixed_bundleid_flag: false) ⇒ Object
- #fixed_push(bundle_id: nil, fixed_bundleid: false) ⇒ Object
-
#initialize(argv) ⇒ Renewcert
constructor
A new instance of Renewcert.
- #run ⇒ Object
Methods included from XcodeCertHelper
#config_infoplist_cert, #config_project_cert, #create_provisioning_info_array, #create_upload_cert_info, #create_upload_provisioning_info, #get_target_name_map, #modify_entitlements_plist, #modify_info_plist_icloud
Methods included from Appselect
#all_deploy_bundle_name, #all_dev_bundle_name, #all_dev_bundleid, #all_itc_bundleid, #all_release_bundleid, #all_tool_bundleid, #deploy_build_setting_json, #dev_build_setting_json, #get_deploy_repo_with_modul_name, #get_deploy_setting_repo, #get_dev_setting_repo, #get_selected_deploy_bundle_name, #get_selected_deploy_bundleid, #get_selected_dev_bundle_name, #get_selected_dev_bundleid, #get_setting_bundleid_withdir, #load_setting, #select_main_app
Methods inherited from Pindo::Command
Methods included from Funlog::Mixin
Methods included from Pindoconfig::Mixin
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, #git_root_directory, #is_git_directory?, #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) ⇒ Renewcert
Returns a new instance of Renewcert.
60 61 62 63 64 65 66 67 68 |
# File 'lib/pindo/command/utils/renewcert.rb', line 60 def initialize(argv) @fast_flag = argv.flag?('fast', false) @fixedid_flag = argv.flag?('fixedid', false) @upload_flag = argv.flag?('upload', false) @renew_cert_flag = argv.flag?('renew', false) super end |
Class Method Details
.options ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/pindo/command/utils/renewcert.rb', line 49 def self. [ ['--fast', '快速更新证书,开发用bundle id只更新dev证书,发布bundle id只更新adhoc证书'], ['--upload', '生成上传JPS的证书'], ['--fixedid', '重新更新bundle id的功能,检查bundle id的功能是否更新'], ['--renew', '重新生成证书'] ].concat(super) end |
Instance Method Details
#fixed_cert(bundle_id: nil, renew_flag: false, upload_flag: false, fixed_bundleid_flag: false) ⇒ Object
99 100 101 102 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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/pindo/command/utils/renewcert.rb', line 99 def fixed_cert(bundle_id:nil, renew_flag:false, upload_flag:false, fixed_bundleid_flag: false) args_temp = [] args_temp << "#{bundle_id}" Pindo::Command::Deploy::Pullconfig::run(args_temp) if fixed_bundleid_flag Pindo::Command::Deploy::Bundleid::run([]) end if @fast_flag if @dev_bundle_id_array.include?(bundle_id) || @tool_bundle_id_array.include?(bundle_id) args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--dev" if renew_flag args_temp << "--renew" end if upload_flag args_temp << "--upload" end Pindo::Command::Deploy::Cert::run(args_temp) end if @deploy_bundle_id_array.include?(bundle_id) args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--adhoc" if renew_flag args_temp << "--renew" end if upload_flag args_temp << "--upload" end Pindo::Command::Deploy::Cert::run(args_temp) end else args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--dev" if renew_flag args_temp << "--renew" end if upload_flag args_temp << "--upload" end Pindo::Command::Deploy::Cert::run(args_temp) args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--adhoc" if renew_flag args_temp << "--renew" end if upload_flag args_temp << "--upload" end Pindo::Command::Deploy::Cert::run(args_temp) end end |
#fixed_push(bundle_id: nil, fixed_bundleid: false) ⇒ Object
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/pindo/command/utils/renewcert.rb', line 165 def fixed_push(bundle_id:nil, fixed_bundleid: false) Pindo::Command::Deploy::Pullconfig::run(args_temp) args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--dev" Pindo::Command::Deploy::Pem::run(args_temp) args_temp = [] args_temp << "--a=#{bundle_id}" args_temp << "--adhoc" Pindo::Command::Deploy::Pem::run(args_temp) end |
#run ⇒ Object
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 |
# File 'lib/pindo/command/utils/renewcert.rb', line 71 def run @dev_bundle_id_array = all_dev_bundleid() @tool_bundle_id_array = all_tool_bundleid() @deploy_bundle_id_array = all_release_bundleid() fixed_bundleid_array = @dev_bundle_id_array + @deploy_bundle_id_array + @tool_bundle_id_array puts fixed_bundleid_array fixed_bundleid_array.each do |bundle_id| # begin if bundle_id.eql?("com.heroneverdie101.*") bundle_id = "com.heroneverdie101" end fixed_cert(bundle_id:bundle_id, renew_flag:@renew_cert_flag, upload_flag:@upload_flag, fixed_bundleid_flag:@fixedid_flag) # rescue => err # puts # puts # puts "Fixed #{bundle_id} cert---------Error-------!!!" # puts # puts # end end end |