Created
February 10, 2016 12:26
-
-
Save richsage/42b7147fb40791633b27 to your computer and use it in GitHub Desktop.
Fastfile configuration for promoting builds from QA to beta
This file contains hidden or 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
platform :ios do | |
lane :qa do | |
increment_build_number | |
# Produce the build here | |
commit_version_bump | |
add_git_tag | |
push_to_git_remote | |
# Push to HockeyApp | |
end | |
lane :beta do |options| | |
original_branch = Actions.git_branch | |
checkout_this = Actions.git_branch | |
cmd = "git tag | grep iosqa" | |
tags = Actions.sh(cmd, log:false).split("\n") | |
if tags.count | |
tag_vs_version = {} | |
tags.each do |tag| | |
elements = tag.split("/"); | |
version = elements.last.to_i | |
tag_vs_version[version] = tag | |
end | |
tag_vs_version = tag_vs_version.sort.to_h | |
checkout_this = tag_vs_version[tag_vs_version.keys.last] | |
puts "QA tag found: using #{checkout_this}" | |
else | |
puts "No QA tags found for iOS" | |
end | |
Actions.sh("git checkout #{checkout_this}") | |
# Produce your build here | |
add_git_tag( | |
build_number: get_build_number | |
) | |
# Revert to previous branch | |
# In the case of QA tags, the repository will be in a detached-head state | |
# and the push_to_git_remote action doesn't account for this | |
Actions.sh("git checkout #{original_branch}") | |
push_to_git_remote | |
# Upload to TestFlight and notify testers | |
pilot | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment