Jenkins Stages Log/XML - jenkins

Where can I find the Jenkins Pipeline stages and its results stored. I am trying to find the logs/xml this image stored, I understand that we can find the system logs in var/logs/jenkins/jenkins.log however my requirement is to capture/find the jobs pipeline stages which might be in logs/xml in the server. If there are any plugins kindly suggest me on the same.
Jenkins Pipeline Stages

Related

How to have the pipeline checked out on Jenkins-agent (scripted pipeline)

When I specify a new job in Jenkins and configure to checkout the "Pipeline script from SCM", this repo will be checked out on the jenkins-agent (if it is a declarative pipeline).
I do have a Makefile right next to my pipeline-description that's being used from within that pipeline.
Now I migrated that pipeline to a scripted pipeline (instead of a declarative one).
Unfortunately jenkins now only checks out the repository on the Jenkins-master, so that the agent doesn't have the Makefile available any longer.
I tried to play around with the skipDefaultCheckout() function that is mentioned in this answer, but this doesn't help.
I want the repo with my scripted pipeline (and the makefile) to be available on the agent as well. Is there such a possibility?

Loading jenkinsFile from local disk and run the Declarative pipeline on the same Agent

I am setting up a Jenkins locally without SCM.
I have several Pipelines with the same JenkinsFile but with different parameters.
I would like to centralize the JenkinsFile for all the pipelines.
I found a solution originally for a scripted pipeline:
node {
load "/path/to/local/jenkinsFile.groovy"
}
The problem here is that Jenkins needs two agents to run the previous pipeline (one for the loading node, the other to run the pipeline) and both of them won't finish before the end of the pipeline.
Since I have multiples pipelines cron triggered, at some point, all the agents are busy to load the pipeline files, but since there is no more available agent to run each pipeline, the Jenkins process is stuck and then there is a bottleneck in the job queue.
For solutions I imagine:
How can I release the agent after the load of the pipeline?
Is there a way at the first pipeline (load the jenkinsFile) to keep an agent for running the pipeline?

Jenkins Pipeline - Can we run a job outside of jenkins pipeline?

I am using jenkins pipeline and my Jenkinsfile has several stages and jobs. Is there any way to run specific job outside of jenkins pipeline ?
Example: Let's say one of the stage is to do "scp build artifacts to remote location". For some reason this got failed and if at all I want to run rest of the jobs manually out of jenkins pipeline, how can I do that ?
I am least interested to invoke a new build. So can we run remaining jobs after failure outside of jenkins pipeline manually ?
You may be able to do it by writing unit test cases to your Jenkinsfile and test them as a maven project. This may or may not solve your problem without looking at your entire problem but if you can reorganize your logic to achieve 100% test coverage then it is doable. You can find more information about writing test cases of Jenkins pipelines here

What is the difference between Build pipeline and Delivery pipeline in Jenkins?

I would appreciate if anyone could briefly point out what the difference between Build and Delivery pipelines in Jenkins? Are they the same with different producers?
I don't have a depth knowledge of both plugin but from my experience, the subtle difference between the Delivery Pipeline Plugin and Build Pipeline Plugin is that the first one allows you to use Freestyle Jobs and Pipeline Jobs while the second one only allows Freestyle Jobs.
So if you're using Shared Libs for your pipelines and want to use any of this plugins to have an overview of downstream and upstream Jobs you should definitely go for Delivery pipeline plugin
Build Pipeline Plugin:
https://plugins.jenkins.io/build-pipeline-plugin/
Delivery Pipeline Plugin:
https://plugins.jenkins.io/delivery-pipeline-plugin/

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

Resources