hockey-app-helpers.fsx 925 B

12345678910111213141516171819202122232425262728293031
  1. module HockeyAppHelper
  2. open Fake
  3. open Fake.XamarinHelper
  4. open System
  5. open System.IO
  6. type HockeyAppParams = {
  7. /// (Required) API token from https://rink.hockeyapp.net/manage/auth_tokens
  8. ApiToken: string
  9. File: string
  10. BuildCounter: string
  11. }
  12. // http://support.hockeyapp.net/kb/api/api-apps#upload-app
  13. let private getCurlArgs token file buildCounter = seq {
  14. yield "-F status=2"
  15. yield "-F notify=0"
  16. yield sprintf "-F \"notes=Build # %s\"" buildCounter
  17. yield "-F notes_type=0"
  18. yield sprintf "-F ipa=@%s" file
  19. yield sprintf "-H X-HockeyAppToken:%s" token
  20. yield "https://rink.hockeyapp.net/api/2/apps/upload"
  21. }
  22. let Upload token file buildCounter =
  23. let args = getCurlArgs token file buildCounter |> String.concat " "
  24. printfn "HockeyApp args are %s" args
  25. let result = Shell.Exec ("curl", args)
  26. if result <> 0 then
  27. failwithf "curl exited with error (%d)" result