Class: Thrust::Android::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/thrust/android/deploy.rb

Instance Method Summary collapse

Constructor Details

#initialize(out, tools, git, testflight, deployment_config, deployment_target) ⇒ Deploy

Returns a new instance of Deploy.



4
5
6
7
8
9
10
11
# File 'lib/thrust/android/deploy.rb', line 4

def initialize(out, tools, git, testflight, deployment_config, deployment_target)
  @out = out
  @tools = tools
  @git = git
  @testflight = testflight
  @deployment_config = deployment_config
  @deployment_target = deployment_target
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/thrust/android/deploy.rb', line 13

def run
  @git.ensure_clean

  begin
    @git.checkout_tag(@deployment_config.tag) if @deployment_config.tag

    @tools.change_build_number(Time.now.utc.strftime('%y%m%d%H%M'), @git.current_commit)
    apk_path = @tools.build_signed_release

    autogenerate_notes = @deployment_config.note_generation_method == 'autotag'
    @testflight.upload(apk_path, @deployment_config.notify, @deployment_config.distribution_list, autogenerate_notes, @deployment_target)

    @git.create_tag(@deployment_target)
    @git.reset
  rescue Exception => e
    @out.puts "\n\n"
    @out.puts e.message.red
    @out.puts "\n\n"

    @git.reset
    exit 1
  end
end