Direct url to the lastest details page of a build - jenkins

I try to set up a public display on our department floor to present the current status of the Jenkin's maintained projects. Therefore I'm cycling through a session of Jenkins web pages like the Blue Ocean Pipeline overview or the detailed build history of particular pipelines.
Blue Ocean Pipeline Build History
Additionally I would like to show the detailed page of the last build step of a pipeline.
Build details of a pipeline
Unfortunately the url that is been called uses the build number which I don't have on my script side. Is there a way within Blue Ocean to call for the last detailed build page in depended of the build number.
* instead of .../blue/organizations/jenkins/Playground_RTM/detail/Playground_RTM/112/pipeline
* something like that .../blue/organizations/jenkins/Playground_RTM/detail/Playground_RTM/last/pipeline
Any ideas?

I could not find a direct dynamic URL in the blue ocean for the last build.
If somebody is looking for providing a quick access link, they could provide link to activity page for a particular branch in blue ocean.
https://<host-name>/blue/organizations/jenkins/<job-name>/activity?branch=<branch-name>
Or provide the last build page URL for classic Jenkins by using the lastBuild keyword.

Related

what is the preferred approach for creating a pipeline in jenkins?

I've used Jenkins a bit here and there but this is my first time to create a pipeline in Jenkins. What is the preferred tool these days for creating a new Jenkins pipeline? Here's the main Jenkins docs page for pipelines:
https://www.jenkins.io/doc/book/pipeline/
The url states:
get started with Pipeline - covers how to define a Jenkins Pipeline
(i.e. your Pipeline) through Blue Ocean, through the classic UI or in
SCM
I viewed the Jenkins Blue Ocean docs page and it has this info towards the top of the page:
Blue Ocean status Blue Ocean will not receive further functionality
updates. Blue Ocean will continue to provide easy-to-use Pipeline
visualization, but it will not be enhanced further. It will only
receive selective updates for significant security issues or
functional defects.
That passage gives me the impression that Blue Ocean may be in a somewhat deprecated state as the tool for creating new pipelines in Jenkins. Is that the case? What is the preferred tool these days for Jenkins admins to create a new pipeline in Jenkins?
You should avoid using Blueocean as it's not going to receive any updates from Cloudbees.
Having said that, Jenkins Pipeline has a declarative syntax. So it doesn't really matter how you create it as long as you adhere to the correct syntax. The correct question you should be asking is where to store your Pipeline. Basically, you can embed the Pipeline in the Jenkins Job itself, or read the Pipeline from an SCM or you can add your pipeline as a shared library.

How can I show an external URL as a build result in Jenkins

Specifically I have a jenkins job that builds and publishes a docker image to our own artifactory instance. What I'm wondering is if it's possible to have the link to that artifactory (or docker hub, or anything else) link in place of the "Last Successful Artifacts" section shown on a build/project page?
For example, if the above image ^^^ had URLs instead of jenkins-archived artifacts. For example the page showing the artifactory page, or something simple like docker pull centos:8.3.2011
As far as i know you cant override the existing links in "Last Successful Artifacts" section, however you have several other options for both FreeStyle and Pipeline jobs:
You can use the Artifactory Plugin to upload your artifacts - it will automatically add links to the artifacts on the build page alongside all relevant Artifactory build info.
You can use the Build Name and Description Setter Plugin to set the build description with the links you want. This description will appear in the upper part of your build page and can include any HTML format you want including icons and links (Safe HTML option must be configured).
You can use the Sidebar Link Plugin to add a customized link to the sidebar menu of your build or project, you can configure the url, link text and the used icon according to your needs.
For using it in pipeline Jobs see the Following Discussion
The Artifactory Plugin is the easiest to use, setting the build description will give you maximum flexibility and the sidebar link is somewhat in the middle of both.

Associate an external application url to jenkins build

I am trying to link or associate an external application url to jenkins job build.
So for every builds, this link or url should be available at the left side and any user can simply click on it to launch the external application.
So far I explored the following plugins for this:
https://wiki.jenkins.io/display/JENKINS/Associated+Files+Plugin - this associates a file or directory to the build , something similar to the html publisher plugin... not a url
https://wiki.jenkins.io/display/JENKINS/DocLinks+Plugin - similar to above , associate a doc from the build artifact directories
https://wiki.jenkins.io/pages/viewpage.action?pageId=52298023 - this Side bar link plugin can associate a external link to the jenkin project, but not to every builds
for me the external link which I am trying to associate to the build , dynamically changes for each build , basically some of the query parameter in the external link, so it's critical to associate it to every builds for tracking and other purposes . ex: the external link will be a like a small web app
http:hostnamexxx:port/somepage?para1=xxx&para2=yyyy
Please let me know if there is any plugin for this specific purpose or any other ideas
This would be the Anchor Chain plugin. I've played around with it a bit:
The docs state that the icon can be omitted. Then however you need to insert a tab character after the URL.
When inserting a link to an icon, it is always relative to Jenkins base URL.

Is it possible to show all the submits from a Perforce depot without having to select a job?

We are currently attempting to setup an instance of Jenkins as our build system for our code base. We have multiple jobs setup (all using the same depot) to build different sections of the code.
We would now like to show the submits from all users pertaining to this depot on the main Jenkins screen rather than being able to view the change lists involved with a certain build (e.g. by selecting a certain job and then the link leading to the build information, etc...). I've looked into possible plugins and the closest one I was able to find was the "All Changes Plugin". This is exactly what we would like, but this is only visible when viewing the details of a build (e.g. which CLs were used to create the build), but would it be possible to show this type of information on the main Jenkins page instead?
Thank you in advance for your help.
You could write an extension for the Dashboard View plugin to provide a portlet containing an aggregated list of changes from perforce, though if you aren't experienced with writing plugins then you might be better off using a separate repository browser such as Fisheye or P4Web to display your changes.

My Jenkins confluence publishing plugin does not work

I have a little issue with my development infrastructure. I have a Jenkins CI and I would like to use the Jenkins Confluence publishing plugin to publish the artifacts on a wiki page. I have followed all the steps within the plugin home page but it does not work.
All configuration have been verified (credentials, etc.)...but still, it does not work. Jenkins even check automatically if the credentials provided are correct and if it can access the target confluence page.
instead, after the build I have the following error :
BUILD SUCCESSFUL
Total time: 15 seconds
Archiving artifacts
[confluence] Unable to locate page: ARTIFACT/App+Artifact+Page.
[confluence] Check that the page still exists. If the Space and/or Page name contain build-time parameters, check that the parameter(s) are set to the proper value(s).
Finished: SUCCESS
ARTIFACT is the space name and App Artifact Page the page name.
Any help would be appreciated
Thanks in advance
The problem is with those pluses in page name. So when your page name is Page Names With Pluses then url in the web browser shows:
http://confluence.example.com/display/Space/Page+Names+With+Pluses
Don't put those pluses in Jenkins' configuration but put Page Names With Pluses and it'll work.

Resources