Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy generated folder from one job to another in Hudson/Jenkins

Tags:

jenkins

hudson

I have two jobs in my Hudson configuration. Let's call them A and B.

Job A was created specifically to generate a folder application_home. This folder is a ready-to-be-used-in-installations-application-home-folder.

Job B is the "pack-all-together-for-installation-job". It needs to copy the application_home generated by job A to generate the installer. My problem is that after some investigation, I was not able to do this in a simple way.

I could use shell script, but then I would need to know job A path plus where its workspace is to get application_ home folder.

Is there a simpler way to do this?

EDIT

I know Copy Artifact Plugin. The problem is that it only copies artifacts. I need to copy the folder application_ home as it is, because it's already in the structure to be used in the installer. If there's a way to use this plugin to copy only the folder, I haven't found it.

EDIT 2. Answer:

Ok, you can do it using Copy Artifact Plugin. You need to

  • Set its configuration to "copy from WORKSPACE of latest completed build".
  • Set Artifacts to copy option the folder like this: target/application_home/**
  • Set Target directory to where you want to somethine like: installation_bundle_folder/application_home.

and it's done :)

like image 820
Caesar Ralf Avatar asked Jan 30 '13 13:01

Caesar Ralf


1 Answers

You could try the Copy Artifact Plugin.

Then you could add a build step to "pack-all-together-for-installation-job" that would copy application_home to the packaging directory. There is an option to only include the latest stable build of Project A.


Another alternative is to have a post-build step for a successful Project A build that scripts the copy of the application_home over to where Project B will use it. You can use the WORKSPACE environment variable to get the absolute location. (See here for a list of environmental variables).

like image 65
yhw42 Avatar answered Oct 01 '22 21:10

yhw42