Class: Thrust::Android::Deploy

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(out, tools, git, testflight, notify, distribution_list, autogenerate_notes, deployment_target) ⇒ Deploy

Returns a new instance of Deploy.



13
14
15
16
17
18
19
20
21
22
# File 'lib/thrust/android/deploy.rb', line 13

def initialize(out, tools, git, testflight, notify, distribution_list, autogenerate_notes, deployment_target)
  @out = out
  @tools = tools
  @git = git
  @testflight = testflight
  @notify = notify
  @distribution_list = distribution_list
  @deployment_target = deployment_target
  @autogenerate_notes = autogenerate_notes
end

Class Method Details

.make(thrust_config, deployment_config, deployment_target) ⇒ Object



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

def self.make(thrust_config, deployment_config, deployment_target)
  tools = Thrust::Android::Tools.new($stdout)
  git = Thrust::Git.new($stdout)

  testflight_config = thrust_config.app_config['testflight']
  testflight = Thrust::Testflight.new($stdout, $stdin, testflight_config['api_token'], testflight_config['team_token'])

  autogenerate_notes = deployment_config['note_generation_method'] == 'autotag'
  new($stdout, tools, git, testflight, deployment_config['notify'], deployment_config['distribution_list'], autogenerate_notes, deployment_target)
end

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
# File 'lib/thrust/android/deploy.rb', line 24

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

  @testflight.upload(apk_path, @notify, @distribution_list, @autogenerate_notes, @deployment_target)

  @git.reset
end