Jenkins, how can I archive a single subdirectory (without it's whole tree structure above)?

StackOverflow https://stackoverflow.com/questions/15299709

  •  18-03-2022
  •  | 
  •  

سؤال

I'm using Jenkins to do nightly build of an iOS static framework. The output that I care about is in this directory:

ios/build/Release-iphoneuniversal/MySpecialProject.framework

I'd like to use the "Archive the artifacts" action to archive "MySpecialProject.framework", but when I do this, it creates a whole archive with the entire leading directory structure. The docs say to look at how Ant does this. I'm not familiar with Ant, so I'm at a loss here.

The main point of this is to make the "MySpecialProject.framework" available as as artifact to other projects being built with Jenkins. So, thinking that I could use the "Copy Artifact" plugin to do that. But I can't really get past this thing where it creates a full directory structure here. I just wan "MySpecialProject.framework" to be the top-level artifact.

Thanks in advance.

هل كانت مفيدة؟

المحلول

I fixed my own problem, by putting in an "Execute Shell" command:

mv ios/build/Release-iphoneuniversal/MySpecialProject.framework .

Then in the post-build action, "Archive the artifacts", I was able to just archive "MySpecialProject.framework/**"

This seems to work quite well. Since each time Jenkins runs the job, it creates a new workspace, I don't have to worry about issues with "mv". Works fine.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top