Sha256: becc87b3d93262658734e4d5e7a5c4ccff3a6167c25145625c08ebd723732d7b

Contents?: true

Size: 1.19 KB

Versions: 65

Compression:

Stored size: 1.19 KB

Contents

require "fastlane_core"
require "pilot/tester_util"

module Pilot
  class TesterExporter < Manager
    def export_testers(options)
      UI.user_error!("Export file path is required") unless options[:testers_file_path]

      start(options)
      require 'csv'

      app_filter = (config[:apple_id] || config[:app_identifier])
      if app_filter
        app = Spaceship::Application.find(app_filter)

        testers = Spaceship::TestFlight::Tester.all(app_id: app.apple_id)
      else
        testers = Spaceship::TestFlight::Tester.all
      end

      file = config[:testers_file_path]

      CSV.open(file, "w") do |csv|
        csv << ['First', 'Last', 'Email', 'Groups', 'Installed Version', 'Install Date']

        testers.each do |tester|
          group_names = tester.groups.join(";") || ""
          latest_install_info = tester.latest_install_info
          install_version = latest_install_info["latestInstalledShortVersion"] || ""
          pretty_date = tester.pretty_install_date || ""

          csv << [tester.first_name, tester.last_name, tester.email, group_names, install_version, pretty_date]
        end

        UI.success("Successfully exported CSV to #{file}")
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
fastlane-2.70.3 pilot/lib/pilot/tester_exporter.rb
fastlane-2.71.0.beta.20171221010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.2 pilot/lib/pilot/tester_exporter.rb
fastlane-2.71.0.beta.20171220010004 pilot/lib/pilot/tester_exporter.rb
fastlane-2.71.0.beta.20171219010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.1 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0.beta.20171217010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0.beta.20171216010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0.beta.20171215010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.3 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0.beta.20171214010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.2 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.1 pilot/lib/pilot/tester_exporter.rb
fastlane-2.70.0.beta.20171213010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.0 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.0.beta.20171212010004 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.0.beta.20171211010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.0.beta.20171210010003 pilot/lib/pilot/tester_exporter.rb
fastlane-2.69.0.beta.20171209010003 pilot/lib/pilot/tester_exporter.rb