My Jenkins confluence publishing plugin does not work - jenkins

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.

Related

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.

No Save/Apply button on Jenkins pipeline configuration page

The Save/Apply button is missing from Jenkins pipeline configuration page. There seems to be no other way to apply changes to the configuration settings. I am unable to find any useful answers or workarounds as well. I have tried several Javascript workarounds, reinstallation, uninstalled plugins that generated warnings, and stuff but nothing seems to be working. I am using Jenkins version 2.222.3 with BlueOcean.
It would be a great help if anyone can suggest a solution.
Jenkins Pipeline configuration is defined in Jenkins Pipeline (e.g. Jenkinsfile). To change your configuration, you need to edit your Jenkinsfile.
E.g. to change "Build periodically", here's an example of edit you need to do:
pipeline {
triggers {
cron('* * * * *') // run every minute
This is why the page you're looking at is called "View Configuration" — it is for viewing only.
Using the GitHub plugin, we have an organization folder that is scanned for any repositories that contain a Jenkinsfile. The configuration you are viewing is driven by a config.xml that is copied from the organization folder into each job that runs in a repo. So you want your changes to affect jobs/my_organization/config.xml, not jobs/my_organization/jobs/my_repo/config.xml.
In the UI this is accomplished by going up a level or two from the job or job run. There you will see the link change from "View Configuration" to "Configure".

How do I fix a Jenkins HTML report "checksum mismatch"?

I got a brand new Jenkins machine running on Linux Ubuntu. I use HTML Publisher Plugin to publish my html reports. I also use Jsystem to invoke the test scenario.
Jenkins 1.643
Html Publisher Plugin 1.10
At the end of the test when open the latest html report from the project main page I get this error:
Checksum mismatch
The checksum of the current wrapper file (0dd0c5ec07dff1d7179f03b5deb290e96ac68f8c) does not match the recorded checksum (090f21ac5f8c4b0eed9e789145a2fe2a6134c900). This indicates a possible security issue, therefore Jenkins will not serve this file. You can access the archived HTML files here.
I have checked existence of file and permissions. If I open the report from the job page then everything works.
UPDATE:
When I open the report from the job page I have no CSS and many errors.
Looks like a security issue.
UPDATE 2:
CSS and Javascript are back, Jenkins had an update on their Content Security Policy. Added args to the Jenkins startup scripts. First issue is still on. :(
It is a bug in that version of the HTML publisher plug in. The bug happens if you have more than one report in your job, mark the publishing option: 'Keep past HTML reports' and then click on the second report.
https://issues.jenkins-ci.org/browse/JENKINS-32281
Solution in https://jenkins.ci.cloudbees.com/job/plugins/job/htmlpublisher-plugin/61/.
Solution is released as 1.11 of the plug in.
it worked for me: Blocked script execution in <URL>. because the document's frame is sandboxed and the 'allow-scripts' permission is not set
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

why i am getting error while accessing the jenkins homepage?

I am not able to display the jenkins homepage properly.
I have installed two VM with jenkins server and accessing the jenkins through putty and windows browser. Scenarion of two jenkins are
with normal connection [working]
in vpn connection [not working]
i can view the homepage of 1st, but not getting proper view of 2nd machine.
It displays only text not working. I mean only texts of login ,logout and build now etc.
when i click on this text getting following error
"Not Found
The requested URL /login was not found on this server."
There is no browser issues i have tried it 2-3 browsers.
I think this is jenkins issues or something else plz help.
You share so few details about how you installed Jenkins and what is the environment that you should not expect any good answers. I suspect the problem is around the correct use of the Jenkins --prefix command line parameter. It changes the way Jenkins constructs URLs for links. I hope this helps. If not, you should consider telling us more about your setup.

Jenkins: Display last console output on project page

When viewing a project in Jenkins, I'd like to see the last console output displayed on the project page.
This satisfies two needs:
I most often just want to see what the output of the build was; clicking through to the last console output seems needlessly cumbersome
Non-technical management can't remember how to / aren't sufficiently motivated to click through to the last console output in cases where the output is relevant to them if only they were to easily see it
I've looked for plugins that support this but can't find any.
What options do I have?
First an easy solution: job descriptions (push 'edit description' button on the main job page) admit HREF links. Make that link your latest build console permalink (http://[jenkins_server]/job/[job-name]/lastBuild/console).
If even one click is too much, here's a possible solution: you can use log contents as the description of your job. You can update your job via Jenkins CLI with:
java -jar jenkins-cli.jar -s http://[jenkins-server] update-job [job-name] < config.xml
So what you need to do is this: after your jobs run, trigger another job that will take the triggering job and console output file as parameters, substitute <description> in the job's config.xml with the contents of the console file (with proper escaping, etc.), and run the update command as above. Of course, this solution is labor-intensive and bug-prone.
I had this same questions myself and I ended up finding this option useful...
http://[jenkins-server]/job/[job-name]/[build-number|lastBuild]/logText/progressiveText?start=0
Edit: This no longer works in the current version of Jenkins
Similar to malenkiy_scot's answer, you can actually embed iframes in the description.
I use:
<iframe src='lastBuild/consoleText' style='width: 80%; height: 500px'></iframe>
as my project description, and it shows the latest console text in the project description page.
I just created a plugin that displays console output of latest build at the project page.
https://github.com/jenkinsci/display-console-output-plugin
To use this plugin, you have to type mvn hpi:hpi to create a display-console-output.hpi file. Then upload this plugin from http://localhost:8080/pluginManager/advanced.
You can simply just use one of these plugins:
http://wiki.hudson-ci.org/display/HUDSON/Hudson+Personal+View
https://wiki.jenkins-ci.org/display/JENKINS/Console+Column+Plugin
May be you don't need it, you can click in the status button in the left of each build, each button show console output for each build.
Of course, this feature may not be operative in all Jenkins versions.
The solution for your problem is the https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin plugin for Jenkins. After installing it you may modify your view to add a button for the console output as an additional column.
For a declarative pipeline, you can show a link to the console right where the progress bar shows up by adding this line at the very top of the file:
currentBuild.description = """Job console"""
This depends on a plugin and a setting, both of which were already on my system:
The OWASP Markup Formatter plugin provides the setting Security > Configure Global Security > Markup Formatter, which should be set to "Safe HTML".
The setting Jenkins -> Manage Jenkins -> Configure System -> Jenkins Location -> Jenkins URL needs to be the URL of your Jenkins installation.

Resources