Class: Thrust::Deploy
- Inherits:
-
Object
- Object
- Thrust::Deploy
- Defined in:
- lib/thrust/deploy.rb
Instance Method Summary collapse
-
#initialize(out, xcode_tools, agv_tool, git, testflight, app_config, deployment_config, deployment_target) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Constructor Details
#initialize(out, xcode_tools, agv_tool, git, testflight, app_config, deployment_config, deployment_target) ⇒ Deploy
Returns a new instance of Deploy.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/thrust/deploy.rb', line 3 def initialize(out, xcode_tools, agv_tool, git, testflight, app_config, deployment_config, deployment_target) @out = out @xcode_tools = xcode_tools @agv_tool = agv_tool @git = git @testflight = testflight @app_config = app_config @deployment_config = deployment_config @deployment_target = deployment_target end |
Instance Method Details
#run ⇒ Object
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 47 48 49 50 51 |
# File 'lib/thrust/deploy.rb', line 14 def run @git.ensure_clean begin @git.checkout_tag(@deployment_config.tag) if @deployment_config.tag if @deployment_config.versioning_method != 'none' if @deployment_config.versioning_method == 'commits' @agv_tool.change_build_number(@git.commit_count, nil, @app_config.path_to_xcodeproj) elsif @deployment_config.versioning_method == 'timestamp-sha' @agv_tool.change_build_number(@git.current_commit, Time.now.utc.strftime('%y%m%d%H%M'), @app_config.path_to_xcodeproj) else @agv_tool.change_build_number(@git.current_commit, nil, @app_config.path_to_xcodeproj) end end app_name = @app_config.app_name target = @deployment_config.target || app_name ipa_file = @xcode_tools.cleanly_create_ipa(target, app_name, @app_config.distribution_certificate, @deployment_config.provisioning_search_query) dsym_path = "#{@xcode_tools.build_configuration_directory}/#{app_name}.app.dSYM" dsym_path = nil unless File.exist?(dsym_path) autogenerate_notes = @deployment_config.note_generation_method == 'autotag' @testflight.upload(ipa_file, @deployment_config.notify, @deployment_config.distribution_list, autogenerate_notes, @deployment_target, dsym_path) @git.create_tag(@deployment_target) @git.reset rescue Exception => e @out.puts "\n\n" @out.puts e..red @out.puts "\n\n" @git.reset exit 1 end end |