The artefacts are not in the workspace, they are stored with the build information, so you can retrieve artifacts from all of the builds that have them stored, from build#1 to latest if you keep them that long.
these are easily accessed from the webUI via <yourserver:port>/job/<job_name>/<build_number>/artifact/ The default file path of these is <jenkins_root>/jobs/<jobname>/builds/<build_tag>/artifact/ however you should not be using this as you can move the directory that the builds are stored in. And all that the copy artifact plugin is doing is getting them from that location and adding them to the current workspace, so that they can be used in further buildsteps without any hardcoded paths. The reason for the different PROMOTED_xxx env variables is that the promotion is a project in it own right, so the variables that are not prefixed, are those of the promotion build itself, and these will change if a promotion is re-ran. but the PROMOTED_xxx one will not as they will still indicate the parent build being promoted. PS. the NODE_LABELS + NODE_NAME might not be available as the promotion process might run on a different slave or maybe the master. On Friday, August 3, 2012 5:23:15 PM UTC+1, qazwart wrote: > > On Fri, Aug 3, 2012 at 11:32 AM, cjo <cjo.john...@gmail.com> wrote: > > As you have the deploying part already configured in the promotion, > > > > All that you need to do is retrieve the artefacts from the build that > you > > need, in to the current workspace, > > This is done with the Copy Artifact Plugin[1] before your deploy > > I'm not sure how the Copy Artifact Plugin will do any good. The > problem is the artifacts I want aren't in the workspace or easily > available. What I did figure out is that I do know where the artifacts > are located, and I could specify that directory. > > Yeah, I ran into the problem that BUILD_ID and JOB_NAME are no longer > the standard Jenkins job name and build id. The promotion build plugin > took them over. There's no documentation in the plugin itself, but it > is on the Wiki (which I didn't see until you pointed them out. What I > did do is print out all the environment variables and discovered them. > There are six of them: > > PROMOTED_ID: old BUILD_ID > PROMOTED_JOB_NAME: old JOB_NAME > PROMOTED_NUMBER: old BUILD_NUMBER > PROMOTED_SVN_REVISION: old SVN_REVISION > PROMOTED_SVN_URL: old SVN_URL > PROMOTED_URL: old BUILD_URL > > The following have been taken over by the promotion plugin: > > BUILD_ID: (Now the promotion ID) > BUILD_NUMBER: (Now the promotion number) > BUILD_TAG (Now > "jenkins-<PROMOTED_JOB_NAME>-promotion-<Description>-<Promotion > #> > BUILD_URL (Now URL to promotion) > JOB_URL (Now the promotion root URL) > > The following are no longer defined: > SVN_REVISION > SVN_URL > > I have no idea what happens to the NODE_LABELS and NODE_NAME, but I > assume these have been replaced by the promotion plugin. > > Hope this helps those who need this plugin. > > -- > David Weintraub > qazw...@gmail.com >