We pulled the change above and rebuilt the plugin but still got 'unable to find job to copy artifact from' errors. We are trying to copy junit test result files from child phases up to the parent job so as to collate build results in one place.

In case someone else is currently blocked by this there is a workaround using the EnvInject plugin. After your build phases have run execute a python build step with the following code. It uses the Jenkins JSON API to create a new file called propsfile containing the build numbers and success/failures of all the child phases that have executed so far as JOB_NAME_BUILD_NUMBER and JOB_NAME_BUILD_SUCCESS (note it replaces hyphens with underscores to avoid invalid environment variables).

#!/usr/bin/env python
import os
import json
import urllib2

url = ""

req = urllib2.Request('%s/api/json' % url, headers = {'Accept' : 'application/json'})
res = urllib2.urlopen(req)
res = json.loads(res.read())

f = open('propsfile', 'w')
try:
    buildNumbers = {}
    for subbuild in res['subBuilds']:
        name = subbuild['jobName'].upper()
        name = name.replace('-', '_')
        f.write('%s_BUILD_NUMBER=%s\n' % (name, subbuild['buildNumber']))
        f.write('%s_BUILD_SUCCESS=%d\n' % (name, subbuild['result'].lower() == 'success'))
finally:
    f.close()

Then add a subsequent envinject step to pull the contents of that propsfile in and you can use the resulting environment variables to copy artifacts from the correct triggered child builds. You can also use the build success environment variables and the ConditionalJob plugin to optionally run steps (in the case where you have an early smoke test phase that prevents the lengthy subsequent phases from executing if it fails).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to