Associate an external application url to jenkins build - jenkins

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.

Related

How do you display a clickable repo link in the Jenkins output?

In my Jenkins Console logs it says:
Obtained jenkins/some.jenkinsfile from git ssh://mygitserver.myorg.com/my/git/repo.git
so I have to copy / paste / edit to get that repo then click about to the Jenkinsfile in your browser.
When you're doing this multiple times every day it becomes a major headache.
Is there anyway to get a simple clickable link?
I would suggest crafting an output that would then become clickable. i.e. declare the link then specify the file using a variable.
script { println("https://yourRepoUrl.com/jenkins/${downloadFile}) }
Alternatively, you could download the file from within the pipeline. See here for details

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.

Veracode as a precommit hook for git

How to integrate Veracode scanner as a pre-commit hook for git working repository? How can we check weather the scanner is actually running?
You can create a GitHub Action about Veracode static scan analysis. To do this you can follow the steps below:
In the Security tab of your GitHub project (you need to have admin rights for the GitHub project), click on "Enable settings" for "Code
scanning alerts".
This takes you to the Settings of the project, where you need to “Enable” “GitHub Advanced Security” for “Code scanning”,
and then click the “Go to code scanning” button that will be enabled.
Scrolling down on the list appearing with multiple code scanning tools, you pick “Veracode Static Analysis” (usually appearing on the bottom of the page).
Clicking to “Set up this workflow”, automatically creates a subdirectory in master branch in .github/workflows path. The workflow is configured in a .yml file, that contains the steps of the pipeline.
Prerequisite: you need to set up Veracode API Keys as Project Secrets (have a look here Create Veracode API keys and here
setup GitHub Action Secrets for Repository. Name your API Keys as VERACODE_API_ID and VERACODE_API_KEY (as these are the names that are set in .yml file or change them accordingly in both locations)
In the .yml file that got created automatically there is a pipeline that runs according to the rules set on the line where it says
you can have a look at this link for more information on push/pull request branches/tags
branch names can be altered, following regular expressions as well, see here for more info.
You can configure the Action to run on schedule as well.
Hover over “cron” to see the man-read format that appears. With this, the Action will run according to cron. Scheduled workflows run on the latest commit on the default or base branch.
Find more information on how to configure scheduled events on GitHub Actions here
In the Actions tab of your Project you can now see the logs of the run of the pipeline and each run's status.
After you have set up the GitHub Action as described above (steps 1-8), and the Action has run well (check its status as described in step 9) in the Security tab of your GitHub project, you should be able to see that "Code scanning alerts" are "Active", click on "View alerts", that takes you to the list of the Veracode flaws if any.

Direct url to the lastest details page of a build

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.

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.

Resources