Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
190 lines (147 sloc) 4.25 KB
# Customise this file, documentation can be found here:
# https://github.com/krausefx/fastlane#customise-the-fastfile
require 'bundler/setup'
require 'fastlane_env_lanes'
before_all do |lane|
# Clean up
# system "(cd ../; (rm -f #{ENV['SCHEME']}.app.dSYM.zip) )"
# system "(cd ../; (rm -f #{ENV['SCHEME']}.ipa) )"
# # Increments build number of your project
# increment_build_number
# # Makes sure all cocoapods are up to date
# cocoapods
# # Runs unit tests
# # - argumnets passed as array of strings
# # - Docs on xctool (https://github.com/facebook/xctool)
# xctool ["-workspace #{ENV['WORKSPACE']}", "-scheme #{ENV['SCHEME']}"]
end
lane :ci_build do
sh "rm -rf build"
xcodebuild(
clean: true,
archive: true,
archive_path: './build/BanditTheCat.xcarchive',
workspace: ENV['WORKSPACE'],
scheme: ENV['SCHEME'],
configuration: 'Release',
sdk: 'iphoneos',
)
xcodebuild(
export_archive: true,
export_path: './build/BanditTheCat'
)
end
lane :test_ci do
puts "test ci"
end
lane :ipa do
ipa({
workspace: ENV['WORKSPACE'],
project: nil,
configuration: nil,
scheme: ENV['SCHEME'],
clean: nil,
archive: nil,
destination: nil,
embed: nil,
identity: nil,
sdk: nil,
# ipa: 'JoshIsAwesome.ipa'
verbose: nil
})
ipa_path = Actions.lane_context[ Actions::SharedValues::IPA_OUTPUT_PATH ]
dsym_path = Actions.lane_context[ Actions::SharedValues::DSYM_OUTPUT_PATH ]
puts "ipa_path = #{ipa_path}"
puts "dsym_path = #{dsym_path}"
end
lane :test do
# Takes all screenshots for you (so magical)
# - Configurations are in Snapfile
# - Steps are defined in the snapshot.js
snapshot
end
lane :do_s3 do
ipa({
workspace: ENV['WORKSPACE'],
scheme: ENV['SCHEME'],
configuration: 'Inhouse'
})
s3({
# access_key: ENV['S3_ACCESS_KEY'],
# secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
# bucket: 'fastlane-test-bucket',
# ipa: 'SnapifeyePro.ipa',
# dsym: 'SnapifeyePro.app.dSYM.zip',
# path: 'v{CFBundleShortVersionString}_b{CFBundleVersion}/',
# html_template_path: "./fastlane/s3_template.erb.html",
# plist_template_path: "/Users/josh/Projects/fastlane/lib/assets/s3_plist_template.erb",
# html_template_path: "/Users/josh/Projects/fastlane/lib/assets/s3_html_template.erb",
# html_file_name: "tehetehe.html"
})
end
lane :beta do
# Gets (and renews) provisioning profiles
sigh({
provisioning_file_name: "Bandit_The_Cat_Dist.mobileprovision"
})
# Builds IPA
ipa({
workspace: ENV['WORKSPACE'],
scheme: ENV['SCHEME'],
configuration: ENV['Inhouse']
})
# Send to HockeyApp
hockey({
api_token: ENV['HOCKEYAPP_API_TOKEN'],
ipa: "./#{ENV['SCHEME']}.ipa",
notify: 1
})
end
lane :deploy do
snapshot
sigh
system "(cd ../; ( ipa build -s #{ENV['SCHEME']} -c Release ) )"
deliver :skip_deploy, :force
end
lane :inhouse do
# sigh
sigh
# Builds IPA
system "(cd ../; ( ipa build -s #{ENV['SCHEME']} -c Inhouse ) )"
upload_to_s3({
ipa_name: ENV['ipa_name'],
scheme: ENV['SCHEME'],
bundle_id: ENV['BUNDLE_ID'],
s3_bucket: ENV['S3_BUCKET'],
s3_access_key: ENV['S3_ACCESS_KEY'],
s3_secret_access_key: ENV['S3_SECRET_ACCESS_KEY']
})
end
# You can define as many lanes as you want
after_all do |lane|
# Create message for slack
message = nil
case lane
when :beta
build_number = Actions.lane_context[ Actions::SharedValues::BUILD_NUMBER ]
url = Actions.lane_context[ Actions::SharedValues::HOCKEY_DOWNLOAD_LINK ]
build_info = Actions.lane_context[ Actions::SharedValues::HOCKEY_BUILD_INFORMATION ]
message = "Deployed build #{build_number} of #{build_info['title']} to HockeyApp - #{url}"
when :inhouse
build_number = `(cd ../; xcrun agvtool what-version -terse)`.strip
version_number = `(cd ../; xcrun agvtool what-marketing-version -terse1)`.strip
version_name = "v#{version_number} (#{build_number})"
url = Actions.lane_context[ Actions::SharedValues::UPLOAD_TO_S3_URL]
message = "Deployed build #{version_name} to S3 - #{url}"
end
# Sebd nessage to slack
if message
slack({
message: message,
success: true,
})
end
end
error do |lane, exception|
# Something bad happened
end
You can’t perform that action at this time.