How to use mongodb-document-upload plugin from jenkins in a pipeline - jenkins

I am trying to connect mongodb server for a jenkins pipeline job to save all the job artifacts in mongodb.
So recently I came across this mongodb-document-upload plugin which is available in post build section for a freestyle job that helps in uploading all json artifacts to mongodb. So I want to know how to use this plugin in a pipeline job? ( Plugin works fine in a freestyle job).

Related

Jenkins build history for all jobs

I'am using Jenkins and I would like to have statistics of all builds executions.
I'am already using the plugin "build-metric" but pipeline jobs are not included in the statistics.
How to include pipeline jobs in the result of this plugin ? Or do you know an another plugin which include pipeline job ?

trigger a Jenkins from bamboo

My requirement:
My build pipeline is in Bamboo and Test integration pipeline is implemented in Jenkins. So once CI pipeline is completed in Bamboo, there should be a trigger from Bamboo to Jenkins job.
I'm aware this can be done via API call to Jenkins, however I also saw that there is some kind of plugin in Bamboo which can integrate with Jenkins.
I could not find the name of that plugin anywhere, can someone of you help me is providing the plugin name ?
Please do let me know for more question.
You might be referring to the following plugin: https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket. However, this plugin is for Bitbucket and not Bamboo. As far as I'm aware, there is no Jenkins specific plugin for Bamboo.
There is however a generic webhooks plugin for Bamboo: https://marketplace.atlassian.com/apps/1220844/webhooks-for-bamboo, which can be configured to trigger Jenkins at the end of a build.

Continuous deployment branch wise using Spinnaker

I'm using Jenkins multibranch pipeline for CI process and for CD using Spinnaker.
I've gone through almost all documents, support channels etc. from spinnaker for "how to create spinnaker multibranch pipeline similarly as jenkins" but didn't find anywhere.
After integrating jenkins to spinnaker, in drop down list of jenkins jobs in spinnaker pipeline configuration, it shows all multibranch jobs separately. Hence for each branch I'd need to go to spinnaker and create pipeline manually.
To solve this, I'm thinking this solution: while running jenkins multibranch pipeline job > create spinnaker pipeline(if not exist) using spin cli with required parameters(branch, version, trigger using jenkins of this running branch job etc) > and trigger the same created spinnaker pipeline after jenkins job executed.
Please advise if there is any other better way to accomplish this.
Thanks.
I am not super familiar with the multibranch plugin, but you can make this simpler by doing [ triggers ] -> [ pipeline stage calling the same pipeline ] rather than calling the entire pipeline via the spin-cli.
Alternatively, if the list of jobs generated is small or well known, you could just update the list of triggers for the same pipeline programmatically as part of your release process.
i.e, in your jenkins job
add this job to list of triggers
run rest of jenkins job
job finishes, spinnaker pipeline triggers

Diffrence between buildflow, multijob and pipeline plugin

what is the difference between buildflow, multijob and pipeline plugin.
If i have jobs need to run on the same node sequentially, which one should i use and why?
I have some parameters that are to be shared by all the jobs. I can do it using multijob and build flow also. which one is preferable?
I am confused.
Use the Pipeline plugin.
From the Build Flow plugin page:
"Deprecated: Users should migrate to https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin"
If you're starting from scratch, the answer is basically the same for the Multijob plugin (prefer the pipeline plugin). The Multijob plugin was created pre-jenkins-2, and the pipeline plugin has implemented much of its functionality. Pipeline is one of the default plugins and is being actively maintained by multiple developers. Here is someone migrating from Multijob to Pipeline in 2016.

Build a Freestyle project using Jenkins Pipeline Job

I am trying to build a code which doesn't have a pom.xml. Also i want to deploy the same to artifactory. Is there a way to build such a project using pipeline job. I can use freestyle job for building the above project. But I was hoping if there is some way to achieve the same in pipeline job. Also I require the groovy script details for artifactory deployment of such kind of project in pipeline job. But the basic question I have is this even feasible?
UPDATE:
We have a freestyle project job in whcih which we package our freestyle code into .tar and then deploy to artifactory using Generic Artifactory Configuration.
Now I am trying to achieve the same using a pipeline job. I get the point that we can use shell script inside Groovy and can build a tar package but how to deploy the tar package to Artifactory using Pipeline job.
if you have only 1 file , you can use maven deploy option , and upload the file.
http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html

Resources