watchbuild 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/bin/watchbuild +2 -2
- data/lib/watchbuild/options.rb +25 -7
- data/lib/watchbuild/runner.rb +20 -17
- data/lib/watchbuild/version.rb +2 -2
- metadata +3 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 60daff3117af5df2bfac210f791dde5508011190
         | 
| 4 | 
            +
              data.tar.gz: 3a3527c23e92fe843fc2c9f4cacc95db61205620
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c6da2fabaec7ea15e0ab95a1b0aedd5124a6142c16e8d87f7dcf66ec5aff4faa20543ece8f512e390cbf9ef8074a98e0496a82654f7b0318ff4d8936dd4df356
         | 
| 7 | 
            +
              data.tar.gz: 716f330eaf3980d38732baf455214163f6d035e8ccb02ffc3c9ce58e6062f53bed8cbaa108e204a8657dcc5bc17085d48c46ff4b3da343630f354d9986fee26c
         | 
    
        data/README.md
    CHANGED
    
    
    
        data/bin/watchbuild
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 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 | | 
| 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
         | 
    
        data/lib/watchbuild/options.rb
    CHANGED
    
    | @@ -9,17 +9,35 @@ module WatchBuild | |
| 9 9 |  | 
| 10 10 | 
             
                  [
         | 
| 11 11 | 
             
                    FastlaneCore::ConfigItem.new(key: :app_identifier,
         | 
| 12 | 
            -
                                                 short_option:  | 
| 13 | 
            -
                                                 env_name:  | 
| 14 | 
            -
                                                 description:  | 
| 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:  | 
| 18 | 
            -
                                                 env_name:  | 
| 19 | 
            -
                                                 description:  | 
| 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:  | 
| 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 | 
             
                  ]
         | 
    
        data/lib/watchbuild/runner.rb
    CHANGED
    
    | @@ -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 | 
            -
             | 
| 12 | 
            -
             | 
| 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 | 
            -
                   | 
| 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  | 
| 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  | 
| 42 | 
            +
                        time_elapsed = Time.at(seconds_elapsed).utc.strftime '%M:%S minutes'
         | 
| 38 43 | 
             
                      else
         | 
| 39 | 
            -
                        time_elapsed = Time.at(seconds_elapsed).utc.strftime  | 
| 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( | 
| 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  | 
| 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( | 
| 70 | 
            +
                  TerminalNotifier.notify('Build finished processing',
         | 
| 66 71 | 
             
                                          title: build.app_name,
         | 
| 67 | 
            -
             | 
| 68 | 
            -
             | 
| 72 | 
            +
                                          subtitle: "#{build.train_version} (#{build.build_version})",
         | 
| 73 | 
            +
                                          execute: "open '#{url}'")
         | 
| 69 74 |  | 
| 70 | 
            -
                  UI.success( | 
| 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( | 
| 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  | 
| 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 | 
            -
                   | 
| 99 | 
            +
                  build
         | 
| 97 100 | 
             
                end
         | 
| 98 101 | 
             
              end
         | 
| 99 102 | 
             
            end
         | 
    
        data/lib/watchbuild/version.rb
    CHANGED
    
    
    
        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. | 
| 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:  | 
| 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. | 
| 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: 
         |