def wait_for_build(version)
      # Attempt to find the build. Re-attempt if the build can not
      # be found on travis yet.
      retry_opts = {
        tries: MAX_BUILD_FIND_ATTEMPTS,
        base_interval: 10
      }
      job_number = nil
      sh_retry("bundle exec travis show #{@cli_args} #{version}",
               opts: retry_opts) do |build_out|
        raise CommandError, "Build for #{version} not found.\n#{build_out}" \
          unless (job_number = build_out.match(/^#(\d+\.\d+) .+BUILD=1.+/)[1])
      end
      job_number
    end
def wait_for_build(version)
      # Attempt to find the build. Re-attempt if the build can not
      # be found on travis yet.
      retry_opts = {
        tries: MAX_BUILD_FIND_ATTEMPTS,
        base_interval: 10
      }
      job_number = nil
      sh_retry("bundle exec travis show #{@cli_args} #{version}",
               opts: retry_opts) do |build_out|
        raise CommandError, "Build for #{version} not found.\n#{build_out}" \
          unless (job_number = build_out.match(/^#(\d+\.\d+) .+BUILD=1.+/)[1])
      end
      job_number
    end
Looks for the travis build and attempts to retry if the build does not
 exist yet.

 @param verison [String] Build version to look for.

 @return [String] Job number for the travis build.