Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish completed builds of a pipeline job to a public Jenkins instance?

I have a private Jenkins running on an internal private network not visible from the internet. I have also a public Jenkins instance, visible from the internet and accessible only over HTTPS.

How can I publish completed builds of a scripted pipeline job from private instance to the public one (including artifacts, logs, test results and so on)?

I know there's a Build Publisher Plugin for Jenkins, but I could not figure out how to use it from scripted pipeline.

EDIT: Build Publisher Plugin cannot be used from pipeline jobs without modifications. Is there any other way to achieve the same?

like image 323
J.V. Avatar asked Jul 29 '19 13:07

J.V.


People also ask

What is the difference between Jenkins job and pipeline?

The major difference between any Jenkins job and a Jenkins Pipeline Job is that the Pipeline Scripted job runs on the Jenkins master. This uses a lightweight executor which uses only some resources to translate in the master to atomic commands that execute or send to the agents.

How do I deploy Jenkins pipeline?

Step 1 − Go to Manage Jenkins → Manage Plugin's. In the available tab, search for 'Build Pipeline Plugin'. Click On Install without Restart. Once done, restart the Jenkins instance.

What is Jenkins publish?

What does it do? This plugin allows records from one Jenkins to be published on another Jenkins. The typical use case is for you to run builds within the firewall, then send the results to another Jenkins which is facing the outside world.

What is post in Jenkins pipeline?

Since the post section of a Pipeline is guaranteed to run at the end of a Pipeline's execution, we can add some notification or other steps to perform finalization, notification, or other end-of-Pipeline tasks. See Glossary - Build Status for the different build statuses: SUCCESS, UNSTABLE, and FAILED.

Can We run multiple jobs in Jenkins pipeline?

You can run multiple jobs and also we can use pipeline in the loop. Jenkins Pipeline supports nicely Big or Medium size projects. Jenkins pipeline is implemented as a code that allows multiple users to edit and execute the pipeline process. We are enough talked about Jenkins job now we see how can we define Jenkins Pipeline.

How do I create a Jenkins pipeline as code?

To use Pipeline as Code, projects must contain a file named Jenkinsfile in the repository root, which contains a “ Pipeline script.” We can create a simple or complex delivery Pipeline as code via Pipeline DSL (Domain-specific Language).

How do I create a pipeline script?

Trigger a new build for a given job. Use the Pipeline Snippet Generator to generate a sample pipeline script for the build step. Name of a downstream job to build. May be another Pipeline job, but more commonly a freestyle or other project.

How do I integrate Jira with Jenkins pipeline?

Execute the Jenkins build pipeline and confirm that it has completed successfully, registering a new Jira ticket automatically, and attaching the Gradle build log file Use the Jira administration console to manage the ticket raised by the Jenkins pipeline build process


1 Answers

As stated here, you can only call plugins that have been made compatible with pipelines, which is the use of a newer API.

And since that build-publisher plugin is not listed in the [jenkinsci/pipeline-plugin COMPATIBILITY3 list, you would need to fork jenkinsci/build-publisher-plugin, and make it compatible with the new pipeline interface.

like image 189
VonC Avatar answered Oct 07 '22 14:10

VonC