Thanks for your help Lucka, I have created a fork of the jenkins project under https://github.com/vimil/jenkins I have also created the artifact-compressor plugin under https://github.com/vimil/artifact-compressor
Basically I have made the following changes to 3 files in Jenkins Core. I added a new Interface called ArtifactAction. this interface has a method call getArtifactsDir(). I modified the getArtifactsDir() method in hudson.model.Run.java to first check if the Run Object has any action that implements ArtifactAction interface. If such an action is present then its getArtifactsDir method is called otherwise the default artifacts location is returned I modified FilePath.java so as to add a new File field called localPath. When the FilePath object is initialized with a File Object then this field is made to refer to it. I also modified all locations where remote field was being used in FilePath.java to first check if localPath is present and use that otherwise fallback to using remote. The intention is to prevent FilePath from instantiating File objects directly but use the File object that was passed to it when it was created. The reason for this is because truevfs library has a class called TFile that extends from File class which provides functionality to treat a zip file as a directory. As long as FIlePath doesn't create new File Objects but uses the File Object that was passed to it all other functions in FilePath won't require any major changes to them. The ArtifactCompressor plugin provides a simple publisher class, that compresses all files in the archive folder of the build to artifacts.zip and deletes the contents of archive folder. The ArtifactCompressor also adds an Action to the build that implements the ArtifactAction interface. This action class returns a TFile object that points to artifacts.zip when its getArtifactsDir method is invoked. Let me know If I my explanation of the changes I've made is clear. Also let me know if there is a better way of doing this. I didn't want to modify FilePath.java but I couldn't find any other way to inject TFile object into it. Thanks Vimil On Fri, Jun 14, 2013 at 1:38 AM, [email protected] <[email protected]>wrote: > > > Dne čtvrtek, 13. června 2013 3:28:06 UTC+2 vimil napsal(a): > >> Hi, >> >> Our Build Scripts generate a lot of log files that we archive as >> artifacts. The issue is that we don't have a way of compressing artifacts >> to a zip file while still being able to access contents using the Artifacts >> link. >> >> I recently came across the TrueVFS project which treats a ZipFile as a >> directory. I am in the process of creating a plugin using this project. >> However I had to make some changes to FilePath and Run classes so that I >> could integrate this project with Jenkins. I am not sure if my changes will >> break any existing functionality. >> >> I would like help from someone to review my changes and see if it is >> possible to get these changes into Jenkins core or suggest a better >> approach. >> >> Here is a screenshot of what I was able to accomplish so far >> >> The 3 folders shown below are actually been read from artifacts.zip file >> stored in the archive folder of the build. >> >> [image: Inline image 2] >> Thanks >> Vimil >> > > Hi, we have the similar issue - I started to work on it, but only for zip > file - I looked that your solution will work not only for zip. If you want > I will be happy to help, because we need this feature as soon as possible. > > Regards, > Lucka > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" 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. > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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.
