I had followed your step 3 (ls -ltr <artifact> | tail -1) but just wanted 
to know any other options.  

I will explore your suggestion mentioned in step 2, thanks for it.

Regards,
Seenu.

On Monday, 8 July 2013 22:33:36 UTC+5:30, Eric Pyle wrote:
>
>  Some thoughts:
>
> 1) If I understand correctly, in your step 1 you run a Maven snapshot 
> build, which creates some artifacts. Assuming you are using a Nexus 
> repository, you can have step 2 download the required artifact from Nexus. 
> You can find an example bash script to do that at [1]. 
>
> 2) You could also copy that just-built artifact to a known directory 
> during step 1. See [2] for an example.
>
> 3) You could write shell script code to look for the latest timestamp 
> directory. Something like this:
> ts_dir=`ls -d 
> /var/lib/jenkins/jobs/myjob/modules/org.opendaylight.controller$distribution.opendaylight/builds/2*|sort|tail
>  
> -1`
>
> Eric
>
>
> [1] 
> http://blog.sonatype.com/people/2011/01/downloading-artifacts-from-nexus-with-bash/
> [2] 
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html
>
>
> On 7/8/2013 4:56 AM, Srinivasa TN wrote:
>  
> Sorry for not being clear in articulating my requirement if my first mail: 
>
>  1) In step 1 of my build plan, I have maven generate the following file: 
>  
> /var/lib/jenkins/jobs/myjob/modules/org.opendaylight.controller$distribution.opendaylight/builds/2013-07-05_19-01-16/archive/org.opendaylight.controller/distribution.opendaylight/0.1.0-SNAPSHOT/*.zip
>
>  2) In step 2 of my build plan (execute shell), I need to refer the above 
> file.  So, I use ${BUILD_ID} to refer 
> -  
> /var/lib/jenkins/jobs/myjob/modules/org.opendaylight.controller$distribution.opendaylight/builds/${BUILD_ID}/archive/org.opendaylight.controller/distribution.opendaylight/0.1.0-SNAPSHOT/*.zip
>
>  3) But BUILD_ID contains the time in which build started, i.e., it has 
> value 2013-07-05_19-00-56.
>
>     So now my question is how do I refer the above file in my exec shell? 
>  (I can't use lastSuccessfullBuild or something like that as my present job 
> is still running).
>
> Regards,
> Seenu.
>
> On Monday, 8 July 2013 14:09:20 UTC+5:30, blaz wrote: 
>>
>> All tasks within same job execution start in same directory. In such case 
>> there should not be any problems with finding build artifacts. This case is 
>> not really Jenkins specific.
>> If you want to use artifacts of job A in job B (triggered by job A) you 
>> should use Copy Artifact 
>> Plugin<http://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin>
>> .
>>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to