Skip to content

Instantly share code, notes, and snippets.

@johndpope-karhoo johndpope-karhoo/Fastfile forked from dalu93/Fastfile
Created Sep 23, 2016

Embed
What would you like to do?
Fastfile example
fastlane_version "1.49.0"
default_platform :ios
######################
slack_webhook = 'https://...' #See Slack Incoming Webhook
slack_default_channel = '#channel'
default_production_scheme = 'YOUR-PRODUCTION-SCHEME'
certificates_output_path = './certificates'
profiles_output_path = './profiles'
apple_team_id = 'YOUR-TEAM-ID'
workspace_path = 'WORKSPACE-PATH'
hockey_production_token = 'TOKEN'
platform :ios do
before_all do
ENV["SLACK_URL"] = slack_webhook
ENV["SCAN_SLACK_CHANNEL"] = slack_default_channel
end
desc "Responsible for building and signing the app"
desc "Accept parameters:"
desc "- scheme : scheme name (Optional)"
private_lane :build_app do |options|
# Download the updated profiles and certificates
cert(
development: (options[:scheme] && options[:scheme] != default_production_scheme,
output_path: certificates_output_path,
team_id: apple_team_id
)
sigh(
output_path: profiles_output_path,
team_id: apple_team_id
)
# Build using gym
gym(
scheme: options[:scheme] || default_production_scheme,
workspace: workspace_path,
export_team_id: apple_team_id
)
end
desc "Creates and uploads the ipa to TestFlight"
lane :prerelease do
# Asks to build the scheme
build_app(
scheme: default_production_scheme
)
hockey(
upload_dsym_only: true,
api_token: hockey_production_token,
notes: '',
notify: '0', # do not notify
status: '1' # do not make available for download
)
# Delivers the app to testflight
testflight(
skip_submission: true,
distribute_external: false
)
end
after_all do |lane|
# This block is called, only if the executed lane was successful
slack(
message: "Fastlane operation completed!!",
channel: slack_default_channel
)
end
error do |lane, exception|
slack(
message: exception.message,
success: false,
channel: slack_default_channel
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.