Skip to content

Instantly share code, notes, and snippets.

@bensheldon
Created June 29, 2013 16:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bensheldon/5891739 to your computer and use it in GitHub Desktop.
Save bensheldon/5891739 to your computer and use it in GitHub Desktop.
RubyMotion rake tasks for deployng adhoc and release builds while pushing dsyms to Crittercism and (for adhoc) pushing builds to TestFlight without using any SDKs.
def build_path
"build/iPhoneOS-6.0-Release/"
end
def ipa_name
'"Today\'s Shirts.ipa"'
end
def dsym_name
'"Today\'s Shirts.dSYM"'
end
def adhoc?
ENV['adhoc'] ? true : false
end
task :set_adhoc do
ENV['adhoc'] = "true"
end
desc "Generate Adhoc build"
task :adhoc => [
:deep_clean,
:set_adhoc,
"archive:distribution",
:zip_dsym,
:send_to_crittercism,
:send_to_testflight
]
desc "Generate App Store Build"
task :appstore => [
:deep_clean,
"archive:distribution",
:zip_dsym,
:send_to_crittercism
]
task :deep_clean do
sh "rake clean"
end
desc "Send to testflight"
task :send_to_testflight do
cmd = <<-CMD
cd #{build_path} &&
curl http://testflightapp.com/api/builds.json
-F file=@#{ipa_name}
-F api_token='#{ENV['TESTFLIGHT_API_TOKEN']}'
-F team_token='#{ENV['TESTFLIGHT_TEAM_TOKEN']}'
-F notes='#{ENV['notes']}'
-F notify=True
-F distribution_lists='dayoftheshirt'
CMD
puts cmd
sh cmd.gsub("\n", "\\\n")
end
task :zip_dsym do
# Remove any existing zip
`rm #{build_path}#{dsym_name}.zip`
sh "cd #{build_path} && zip -r dayoftheshirt.dsym.zip #{dsym_name}"
end
desc "Send to crittercism"
task :send_to_crittercism do
if adhoc?
env = 'adhoc'
else # Release
env = 'release'
end
config = YAML.load_file("config/#{env}.yml")
app_id = config['crittercism']['appId']
api_key = ENV["CRITTERCISM_#{env.upcase}_API_KEY"]
cmd = <<-CMD
cd #{build_path} &&
curl "https://api.crittercism.com/api_beta/dsym/#{app_id}"
-F dsym=@"dayoftheshirt.dsym.zip"
-F key="#{api_key}"
CMD
puts cmd
sh cmd.gsub("\n", "\\\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment