watchbuild 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47669dd195f5b35c1b7cc0fa6d34e0c99fae5afc
4
- data.tar.gz: 390e4af1db3174483173f5551f6f8437d787cf15
3
+ metadata.gz: 60daff3117af5df2bfac210f791dde5508011190
4
+ data.tar.gz: 3a3527c23e92fe843fc2c9f4cacc95db61205620
5
5
  SHA512:
6
- metadata.gz: 288deb41e436570d3ba967e95606d6d5509a399cd4c5bcc0fb72af41aa611a7058ab976cc513390cb474384690ac1189004f5c91d20d78d34a7f640ab0bd8d85
7
- data.tar.gz: 6d7df75ce827424e265661b6caf612c3d6816891c9b4d26d5b55f70b721232ed7aea898f25277b009460f1add8cf4ad2ee8c3192045a25c6aad7d2ede704294a
6
+ metadata.gz: c6da2fabaec7ea15e0ab95a1b0aedd5124a6142c16e8d87f7dcf66ec5aff4faa20543ece8f512e390cbf9ef8074a98e0496a82654f7b0318ff4d8936dd4df356
7
+ data.tar.gz: 716f330eaf3980d38732baf455214163f6d035e8ccb02ffc3c9ce58e6062f53bed8cbaa108e204a8657dcc5bc17085d48c46ff4b3da343630f354d9986fee26c
data/README.md CHANGED
@@ -20,6 +20,7 @@
20
20
  <a href="https://github.com/fastlane/fastlane/tree/master/scan">scan</a> &bull;
21
21
  <a href="https://github.com/fastlane/fastlane/tree/master/match">match</a>
22
22
  </p>
23
+
23
24
  -------
24
25
 
25
26
  WatchBuild
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.push File.expand_path("../../lib", __FILE__)
3
+ $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
4
4
 
5
5
  require 'watchbuild'
6
6
  require 'commander'
@@ -29,7 +29,7 @@ class WatchBuildApplication
29
29
  c.syntax = 'watchbuild'
30
30
  c.description = 'Renews the certificate (in case it expired) and outputs the path to the generated file'
31
31
 
32
- c.action do |args, options|
32
+ c.action do |_args, options|
33
33
  WatchBuild.config = FastlaneCore::Configuration.create(WatchBuild::Options.available_options, options.__hash__)
34
34
  WatchBuild::Runner.new.run
35
35
  end
@@ -9,17 +9,35 @@ module WatchBuild
9
9
 
10
10
  [
11
11
  FastlaneCore::ConfigItem.new(key: :app_identifier,
12
- short_option: "-a",
13
- env_name: "APP_IDENTIFIER",
14
- description: "The bundle identifier of your app",
12
+ short_option: '-a',
13
+ env_name: 'APP_IDENTIFIER',
14
+ description: 'The bundle identifier of your app',
15
+ code_gen_sensitive: true,
15
16
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
16
17
  FastlaneCore::ConfigItem.new(key: :username,
17
- short_option: "-u",
18
- env_name: "FASTLANE_USER",
19
- description: "Your Apple ID Username",
18
+ short_option: '-u',
19
+ env_name: 'FASTLANE_USER',
20
+ description: 'Your Apple ID Username',
21
+ code_gen_sensitive: true,
20
22
  default_value: user),
23
+ FastlaneCore::ConfigItem.new(key: :itc_team_id,
24
+ short_option: '-k',
25
+ env_name: 'FASTLANE_ITC_TEAM_ID',
26
+ description: "The ID of your iTunes Connect team if you're in multiple teams",
27
+ optional: true,
28
+ code_gen_sensitive: true,
29
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
30
+ default_value_dynamic: true),
31
+ FastlaneCore::ConfigItem.new(key: :itc_team_name,
32
+ short_option: '-p',
33
+ env_name: 'FASTLANE_ITC_TEAM_NAME',
34
+ description: "The name of your iTunes Connect team if you're in multiple teams",
35
+ optional: true,
36
+ code_gen_sensitive: true,
37
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
38
+ default_value_dynamic: true),
21
39
  FastlaneCore::ConfigItem.new(key: :sample_only_once,
22
- description: "Only check for the build once, instead of waiting for it to process",
40
+ description: 'Only check for the build once, instead of waiting for it to process',
23
41
  is_string: false,
24
42
  default_value: false)
25
43
  ]
@@ -8,12 +8,17 @@ module WatchBuild
8
8
  # returns the path the newly created provisioning profile (in /tmp usually)
9
9
  def run
10
10
  FastlaneCore::PrintTable.print_values(config: WatchBuild.config,
11
- hide_keys: [],
12
- title: "Summary for WatchBuild #{WatchBuild::VERSION}")
11
+ hide_keys: [],
12
+ title: "Summary for WatchBuild #{WatchBuild::VERSION}")
13
13
 
14
14
  UI.message("Starting login with user '#{WatchBuild.config[:username]}'")
15
+
16
+ ENV['FASTLANE_ITC_TEAM_ID'] = WatchBuild.config[:itc_team_id] if WatchBuild.config[:itc_team_id]
17
+ ENV['FASTLANE_ITC_TEAM_NAME'] = WatchBuild.config[:itc_team_name] if WatchBuild.config[:itc_team_name]
18
+
15
19
  Spaceship::Tunes.login(WatchBuild.config[:username], nil)
16
- UI.message("Successfully logged in")
20
+ Spaceship::Tunes.select_team
21
+ UI.message('Successfully logged in')
17
22
 
18
23
  start = Time.now
19
24
  build = wait_for_build(start)
@@ -32,17 +37,17 @@ module WatchBuild
32
37
  seconds_elapsed = (Time.now - start_time).to_i.abs
33
38
  case seconds_elapsed
34
39
  when 0..59
35
- time_elapsed = Time.at(seconds_elapsed).utc.strftime "%S seconds"
40
+ time_elapsed = Time.at(seconds_elapsed).utc.strftime '%S seconds'
36
41
  when 60..3599
37
- time_elapsed = Time.at(seconds_elapsed).utc.strftime "%M:%S minutes"
42
+ time_elapsed = Time.at(seconds_elapsed).utc.strftime '%M:%S minutes'
38
43
  else
39
- time_elapsed = Time.at(seconds_elapsed).utc.strftime "%H:%M:%S hours"
44
+ time_elapsed = Time.at(seconds_elapsed).utc.strftime '%H:%M:%S hours'
40
45
  end
41
46
 
42
47
  UI.message("Waiting #{time_elapsed} for iTunes Connect to process the build #{build.train_version} (#{build.build_version})... this might take a while...")
43
48
  rescue => ex
44
49
  UI.error(ex)
45
- UI.message("Something failed... trying again to recover")
50
+ UI.message('Something failed... trying again to recover')
46
51
  end
47
52
  if WatchBuild.config[:sample_only_once] == false
48
53
  sleep 30
@@ -57,19 +62,19 @@ module WatchBuild
57
62
  require 'terminal-notifier'
58
63
 
59
64
  if build.nil?
60
- UI.message "Application build is still processing"
65
+ UI.message 'Application build is still processing'
61
66
  return
62
67
  end
63
68
 
64
69
  url = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/#{@app.apple_id}/activity/ios/builds/#{build.train_version}/#{build.build_version}/details"
65
- TerminalNotifier.notify("Build finished processing",
70
+ TerminalNotifier.notify('Build finished processing',
66
71
  title: build.app_name,
67
- subtitle: "#{build.train_version} (#{build.build_version})",
68
- execute: "open '#{url}'")
72
+ subtitle: "#{build.train_version} (#{build.build_version})",
73
+ execute: "open '#{url}'")
69
74
 
70
- UI.success("Successfully finished processing the build")
75
+ UI.success('Successfully finished processing the build')
71
76
  if minutes > 0 # it's 0 minutes if there was no new build uploaded
72
- UI.message("You can now tweet: ")
77
+ UI.message('You can now tweet: ')
73
78
  UI.important("iTunes Connect #iosprocessingtime #{minutes} minutes")
74
79
  end
75
80
  UI.message(url)
@@ -84,16 +89,14 @@ module WatchBuild
84
89
  def find_build
85
90
  build = nil
86
91
  app.latest_version.candidate_builds.each do |b|
87
- if !build or b.upload_date > build.upload_date
88
- build = b
89
- end
92
+ build = b if !build || b.upload_date > build.upload_date
90
93
  end
91
94
 
92
95
  unless build
93
96
  UI.user_error!("No processing builds available for app #{WatchBuild.config[:app_identifier]}")
94
97
  end
95
98
 
96
- return build
99
+ build
97
100
  end
98
101
  end
99
102
  end
@@ -1,4 +1,4 @@
1
1
  module WatchBuild
2
- VERSION = "0.2.0"
3
- DESCRIPTION = "Get a notification once your iTunes Connect build is finished processing"
2
+ VERSION = '0.3.0'.freeze
3
+ DESCRIPTION = 'Get a notification once your iTunes Connect build is finished processing'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-22 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane
@@ -205,9 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  requirements: []
207
207
  rubyforge_project:
208
- rubygems_version: 2.6.8
208
+ rubygems_version: 2.4.5.5
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Get a notification once your iTunes Connect build is finished processing
212
212
  test_files: []
213
- has_rdoc: