Possible to copy artifacts to a dynamic directory?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible to copy artifacts to a dynamic directory?

afrosteve
I'm trying to get Jenkins to copy the artifacts of a build to an
archive directory on another server using the scp plugin.

Ideally, I'd like to be able to have the destination be dynamic based
on the build version so the result would like something like /builds/
<build version>/

For a build version like 1.2.3.4 it would look like:

/builds/1.2.3.4/

From reading the scp plugin page, it doesn't look like this is
possible but I figured someone here may have figured it out.

Is there a way to do this?

Is it better practice to just put the artifacts with the version
number embedded in the file name in one directory?
Bap
Reply | Threaded
Open this post in threaded view
|

Re: Possible to copy artifacts to a dynamic directory?

Bap
Hi,

Try http://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin

and set the "Remote directory" to builds/$BUILD_NUMBER, or  
$SVN_REVISION, or whatever you are using for your version.

If you are using a "version" that is only available during the build,  
then try creating a directory structure in your build like:

workspace/some-path/<build version>/<files and/or directories>

Then set "Source files" to workspace/some-path/ (with the trailing slash)
and "Remove prefix" to workspace/some-path
and set the "Remote directory" to wherever you want the versioned  
directory to appear on the remote server.

Bap.


Quoting afrosteve <[hidden email]>:

> I'm trying to get Jenkins to copy the artifacts of a build to an
> archive directory on another server using the scp plugin.
>
> Ideally, I'd like to be able to have the destination be dynamic based
> on the build version so the result would like something like /builds/
> <build version>/
>
> For a build version like 1.2.3.4 it would look like:
>
> /builds/1.2.3.4/
>
> From reading the scp plugin page, it doesn't look like this is
> possible but I figured someone here may have figured it out.
>
> Is there a way to do this?
>
> Is it better practice to just put the artifacts with the version
> number embedded in the file name in one directory?
>

Reply | Threaded
Open this post in threaded view
|

Re: Possible to copy artifacts to a dynamic directory?

afrosteve
Great!

Thank you.

On Mar 9, 3:11 pm, Bap <[hidden email]> wrote:

> Hi,
>
> Tryhttp://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin
>
> and set the "Remote directory" to builds/$BUILD_NUMBER, or  
> $SVN_REVISION, or whatever you are using for your version.
>
> If you are using a "version" that is only available during the build,  
> then try creating a directory structure in your build like:
>
> workspace/some-path/<build version>/<files and/or directories>
>
> Then set "Source files" to workspace/some-path/ (with the trailing slash)
> and "Remove prefix" to workspace/some-path
> and set the "Remote directory" to wherever you want the versioned  
> directory to appear on the remote server.
>
> Bap.
>
> Quoting afrosteve <[hidden email]>:
>
>
>
>
>
>
>
> > I'm trying to get Jenkins to copy the artifacts of a build to an
> > archive directory on another server using the scp plugin.
>
> > Ideally, I'd like to be able to have the destination be dynamic based
> > on the build version so the result would like something like /builds/
> > <build version>/
>
> > For a build version like 1.2.3.4 it would look like:
>
> > /builds/1.2.3.4/
>
> > From reading the scp plugin page, it doesn't look like this is
> > possible but I figured someone here may have figured it out.
>
> > Is there a way to do this?
>
> > Is it better practice to just put the artifacts with the version
> > number embedded in the file name in one directory?