I have a job that runs a makefile and generates some files. I then want another job that publishes these files to ivy.
I am aware of the clone workspace plugin, but is there any other options?
You can use Parameterized Trigger Plugin which will let you pass parameters from one task to another. You need also add this parameter you passed from upstream in downstream.
You can follow the below steps to trigger a Jenkins pipeline in another Jenkins pipeline. Select a job that triggers a remote one and then go to Job Configuration > Build section > Add Build Step > Trigger builds on remote/local projects option.
In Jenkins, there are several ways to implement parallel job execution. One of the common approaches is the parent-child build model. In this model - a parent (upstream) job is triggering child (downstream) jobs.
You run a Makefile, and you're publishing to Ivy?
Ivy is part of Ant, and is a module that takes advantage of the worldwide Maven repository structure to grab required jarfiles and other dependencies.
Don't get me wrong, I've used a local remote Maven repository to publish C/C++ libraries (you can use wget
to fetch the items) that other projects will depend upon. But, I didn't do that using Ivy.
If you're thinking of Apache Ivy, then you can publish using Maven. There's a Maven Release plugin that will copy your artifact to your Maven repository, but what you probably want to do is deploy.
In my Jenkins builds, I simply had Jenkins execute maven's deploy-file
step from the command line. This allowed me to deploy files into my Maven Ivy repository without having to first create a pom.xml file. (Well, you want to create a pom.xml anyway because you want to include a dependency hierarchy.)
I usually did this in the same job as the job that created my jar/war/ear file. However, if you want a separate job to do this, you can use the Copy Artifact Plugin. This plugin allows Job B to copy any or all of the published artifacts from Job A. That's a lot faster and simpler than cloning a whole workspace if you just want the built jar files.
My personal preference is to do these sort of things without relying on the Jenkins internal file structure, though sometimes this mean knowing about the internal structure of your other build tools (e.g., Maven, or in your case Ivy).
If I were you, I'd do everything in one job - i.e., build, and then have an "Ivy Publisher" (if such a plug in exists) publish the artifact to the remote Ivy repository.
If that's not possible, have the first job "install" the artifact into the local repository/cache (I'm not sure what it's called on Ivy), and then have the second job pick it up from there.
I'm not sure this is necessarily the best approach, but it has worked well for me.
Edit I should mention - this doesn't work so well on distributed environments, unless like me, your distributed environment consists of multiple nodes that have access to a common NAS filesystem.
Edit 2 I have also used the Copy To Slave Plugin for distributed environments without a common filesystem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With