Skip to content

Instantly share code, notes, and snippets.

@richsage
Created February 10, 2016 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richsage/42b7147fb40791633b27 to your computer and use it in GitHub Desktop.
Save richsage/42b7147fb40791633b27 to your computer and use it in GitHub Desktop.
Fastfile configuration for promoting builds from QA to beta
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