Created
May 29, 2019 03:03
-
-
Save joshdholtz/7b44976d394e21b8049f69f25f052d92 to your computer and use it in GitHub Desktop.
Restart Fastlane::BuildWatcher and call Pilot::BuildManager.new.distribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fastlane watch_and_dist | |
# or | |
# fastlane watch_and_dist username:"your@email.com" team_name:"Team Name" app_identifier:"com.your_app" version:"1.1" build_number:"239" groups:"Group1,Group2" | |
lane :watch_and_dist do |options| | |
# Set ENVs for Spaceship and Pilot | |
ENV['FASTLANE_USER'] ||= options[:username] | |
ENV['FASTLANE_ITC_TEAM_NAME'] ||= ENV['FASTLANE_TEAM_NAME'] = options[:team_name] | |
# Prompt for needed app/build info | |
app_identifier = options[:app_identifier] || UI.input("App Identifier") | |
version = options[:version] || UI.input("Version") | |
build_number = options[:build_number] || UI.input("Build Number") | |
# Prompt for groups | |
groups = options[:groups] || UI.input("Groups (comma separated):") | |
groups = groups.split(",") | |
# Login to spaceship because we need to find the app | |
fastlane_require 'spaceship' | |
Spaceship::Tunes.login | |
Spaceship::Tunes.select_team | |
# Find app and wait for processing | |
app = Spaceship::Tunes::Application.find(app_identifier) | |
build = FastlaneCore::BuildWatcher.wait_for_build_processing_to_be_complete( | |
app_id: app.apple_id, | |
train_version: version, | |
build_version: build_number | |
) | |
# Distribute build to external testers | |
fastlane_require 'pilot' | |
config = { | |
app_identifier: app.bundle_id, | |
distribute_external: true, | |
groups: groups, | |
# Need this | |
notify_external_testers: false, | |
} | |
Pilot::BuildManager.new.distribute(config, build: build) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment