Question

I could not figure out how to command Jenkins to upload an APK to Testfairy. I know that Testfairy has an API for this, see the link below:

http://blog.testfairy.com/how-to-upload-an-app-to-testfairy-via-api/

I'm new to this, how do I use the API?

Was it helpful?

Solution 2

Well, according to the documentation you linked, you need to run:
sh testfairy-upload.sh yourfile.apk
This also means this is just for *nix OS and maybe Mac, but not Windows.

You need to download their testfairy-upload.sh script and save it somewhere accessible to Jenkins, preferably in the SVN/SCM. Then you need to open that file and modify the top parts of it, namely TESTFAIRY_API_KEY, TESTER_GROUPS, KEYSTORE,STOREPASS, and ALIAS with your own information.

There are many ways to trigger this after the build, but the most straightforward is to add a new build step after your APK building step.

  • Add Execute Shell build step
  • Write /path/to/testfairy-upload.sh ${WORKSPACE}/path/to/yourfile.apk
  • Obviously replace /path/to/ with actual path (if in local directory, you have to use ./testfairy-upload.sh). Replace yourfile.apk with the artifact of your build, whatever its name is, and provide appropriate path to it (within ${WORKSPACE})

If you are on a Windows environment, you would have to re-write that script in Batch

OTHER TIPS

And now there's a plugin that does the dirty work for you:

https://wiki.jenkins-ci.org/display/JENKINS/TestFairy+Plugin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top