0

I'm new to Jenkins and CI. I'm trying to set up a job that picks up an artifact (.apk file)from a different project and uses it as the apk for my parameterized job.(mobile automation)

Problem is that the name of the apk changes everytime with a few variables. So i need to be able to pick this apk and trigger my job.

With what I've set up, i get a null pointer exception for my build even though the build gets copied into workspace.

Could anyone please direct me.

isherwood
  • 46,000
  • 15
  • 100
  • 132
SM06
  • 1
  • 1
  • @isherwood thank you very much. I'll try these as well. To be clearer, job A triggers job B. Job A artifact (apk file) is a parameter for Job B. Since, i have just been exploring since yesterday, one option I'm also thinking of, is if i could pass the build number as the parameter to job B after job A runs successfully. I can play with this information to build the Jenkins url which would then direct me to the apk file itself. Any information would be very useful. Thanks again – SM06 Mar 23 '16 at 23:16

1 Answers1

0
  1. You first need to archive artifacts before you can copy them . Its a post-build action. To specify your apk you can use the wildcard *.apk there, check Archive the artifacts in hudson/jenkins

  2. You need to allow other projects to copy over your artifacts, check "Permission to copy artifacts" https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin

  3. In the job you want to use those artifacts, specify the build step "Copy artifacts from another project"


Edit: Maybe i misunderstood your question, if you have the artifacts already copied into your workspace, either rename it with a wildcard, i.e. mv *.apk staticname.apk.

Or add a shell script that saves the name of your apk into a parameter, which you then can reference in your tests. Check this for how to set and publish variables.

Community
  • 1
  • 1
Dominik Gebhart
  • 2,640
  • 1
  • 11
  • 27