using multibranch artifacts in subsequent pipeline

281 views
Skip to first unread message

Tom Gwozdz

unread,
Oct 3, 2016, 11:26:27 AM10/3/16
to Jenkins Users
I have a multi-branch pipeline project set up to build some libraries.  I want to use the generated artifacts from this pipeline in a subsequent project which is also a multi-branch pipeline.  However, in the second project, I would like to copy the artifacts from the first project where the branch names match, or default to master if there is no such matching branch.

For example, Project 1 has branches called master, and feature1.  Project 2 has branches named master, feature1 and feature2.  I would like to set up the pipeline for Project2 to pull artifacts from master for its master and project2 builds, but from project1 for its project1 build.

Is this something that's easily doable with the current pipeline system?  I think I may be able to use the Copy Artifact Plugin to do part of this, but I'm not sure how I'd set up the fallback case where the preceding project's branch doesn't match the current project's branch.

Thanks!
Tom

Tom Gwozdz

unread,
Oct 4, 2016, 3:05:25 PM10/4/16
to Jenkins Users
My specific use case for this is this.  Say I have a Game Engine project.  I then create a Game project that uses the Game Engine project.  On the Game project, I then create a branch and do a bunch of work on a new feature.  My multi-branch pipeline creates a pipeline for this and starts building it for me, which is great.  The Game multi-stage pipeline depends on the Game Engine multi-stage pipeline, and by default, I have it set up to just pull the artifacts from the Game Engine master branch.

I then add a new feature to the Game project that requires changes to the Game Engine project.  But I need to be able to test these along side eachother.  So I create a branch in the Game Engine project and start making some changes there.  Locally, my Game project can point at my local Game Engine, and things still work.  But on Jenkins, my Game project is still pulling artifacts from the Game Engine master branch, and isn't aware of the dependency on the specific branch of the Game Engine, so my builds fail.

The way I would like to solve this is that I can set up my Game pipeline to pull either master, or its own branch name within Game Engine.  That way, if I create the same branch in both Game and Game Engine, they'll now be related on Jenkins as well, and the builds continue to work.

Is something like this possible?  Or if not, is there another way to accomplish this kind of workflow where I might need to make changes to two different projects that are each built in a multi-branch pipeline, and still have them build correctly?

Thanks!
Tom
Reply all
Reply to author
Forward
0 new messages