Skip to content

Instantly share code, notes, and snippets.

@Lezh1k

Lezh1k/Fastfile Secret

Created November 25, 2019 10:34
ios-pipeline-before-all
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
before_all do |lane, options|
ENV["XCODE_PROJ"] = "<XCODE_PROJ>.xcodeproj"
ENV["XCWORKSPACE"] = "<XCWORKSPACE>.xcworkspace"
ENV["TEAM_ID"] = "<TEAM_ID>"
# FORCE UPDATE XCODE - will check current version. If we don't have needed - will install it.
xcode_install(
version: "11.1",
username: ENV["APPLE_ID"],
team_id: ENV["TEAM_ID"]
)
# KEYCHAIN_PASSWORD - password that allows to login to this computer.
unlock_keychain(path: "login.keychain",password: ENV["KEYCHAIN_PASSWORD"])
# clear_derived_data
# need to set variables before other scripts
if options[:production]
setup_production()
else
setup_staging()
end
plist()
# do not change order. need to fetch plist before get plist
# this value will be stored in Actions.lane_context[SharedValues::VERSION_NUMBER]
get_version_number(
xcodeproj: ENV["XCODE_PROJ"],
target: ENV["APP_NAME"]
)
ENV["IOS_SLACK_NAME"] = "iOS #{ENV["APP_NAME"]} v: #{Actions.lane_context[SharedValues::VERSION_NUMBER]} build (pipeline_id): #{ENV["CI_PIPELINE_ID"]}"
end #:before_all do
###########################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment