For each build in jenkins there's a page with a short summary of what happened in that build.
In my setup this page contains the list of commit messages that were added in this build, the name of the user who started that build and a note from the git plugin about the commit SHA1 and the branch name.
Is there a way for a normal script that I run as a build step to add something to this page? Is there a plugin which allows this?
I want to add a line with an HTML link to where the user can download this build.
You can use the Description Setter plugin to add a custom HTML description.
A quick example :)
Does it help?
UPDATE: here is the syntax for a Jenkins pipeline script
currentBuild.description = "<a href='http://stackoverflow.com'>Stackoverbuild build" + env.BUILD_ID + "</a>"
I used Badge Plugin for something like this.
Example:
def summary1 = createSummary(icon:"notepad.png", text:"started Builds:<br>")
summary1.appendText("myBuild1: SUCCESS<br>", false)
summary1.appendText("myBuild2: UNSTABLE<br>", false)
Related
I have installed external avatar plugin for Gerrit.
gerrit.config:
[avatar]
url = https://outlook.office.com/owa/service.svc/s/GetPersonaPhoto?email=%s
Is there a way to replace %s for email? Because %s is taking username by default.
Are you using the avatars/external plugin? This plugin was deprecated and replaced by the avatars-external plugin. In the new plugin you can use something like this:
url = http://example.org/avatars/${user}.jpg
See more info here
You could try to use ${user} or maybe it's time to update your plugin.
In Jenkins classic interface it is possible to create a link in the output console, but I can't see how I can make something clicable in the Blue Green interface.
You can get the solution here :
How to display a hyperlink in hudson/jenkins build output console
You can also use a workaround for that which is fairly customisable than the method mentioned above.
After finishing your build you can add functionality to your build to send a mail with the report link.
You can do it through the Jenkinsfile or using the job configuration as well.
The Jenkinsfile groovy script is as follows.
script {
emailext subject: ' REPORT-Version/'+ "${G_BRANCH}" + ' $DEFAULT_SUBJECT' ,
body: "Click the link below to show Mocha Testing Results for your current build :<br><br>BAE 4.5 Release Report" ,
attachLog: true,
replyTo: '$DEFAULT_REPLYTO',
to: '$DEFAULT_RECIPIENTS'
}
Through Job configuration you can go to Job --> Configure --> Post Build Actions --> Editable Email Notifications.
Well, it works almost out of the box. Blue Ocean automatically recognizes URL patterns and transform it in a clickable link. For example:
echo "CUCUMBER: ${BUILD_URL}cucumber-html-reports/overview-features.html"
Unfortunately it looks like it isn't possible to create a clickable arbitrary text.
How would I run "Replace" within WriteCustomSummaryInfo step.
I'm trying to display a link to an html report on the build summary:
Get drop location which I do:
\tfsbuild03\temp\Dev-Deployment\Dev-Deployment_20160115.22
replace all \ with / and append report.html at the end
I assume this is the way to do it.
I've tried the following but it doesn't work:
String.Format("dotCover [Coverage Results]file:({0})/{1}", Replace(DropLocation,"\","/"), "report.html")
EDIT
I figured it out. It's suppose to be this:
String.Format("dotCover [Coverage Results]file:({0})/{1}", DropLocation.Replace("\", "/"), "report.html")
i use the grunt-protractor-runner to run my protractor tests with jenkins. Now jenkins needs the xml output to inform me about the test run.
I have installed jasmine-reporters. I have read all other topics and i am sure the installation is correct but i do not receive any output files from it...
Could you please help me?
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('configurations/protractor/xmloutput', true, true));
i have installed jasmine-reporters version 1.0.1
I have a similar setup using grunt-protractor-runner, but I don't generate an XML for Jenkins. You could use the protractor-html-screenshot-reporter
This will generate an html report. I then configured Jenkins to publish the HTML report using the HTML Reporter plugin which gives a tidy link on the page and displays the results in a tabular format.
The conf.js needs the following two snippets
var HtmlReporter = require('protractor-html-screenshot-reporter');
var path = require('path');
and
onPrepare: function() {
var directory = __dirname;
browser.baseUrl = process.argv[3];
htmlFilePath = directory + '\\reports\\';
// Add a screenshot reporter and store screenshots:
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: directory + '\\reports',
preserveDirectory: true
}));
}
This is a very late answer. I post it just in case someone run into this and somehow get link to this question. In our case, we are trying to use teamcity reporter instead of XML reporter. The problem may be caused by your protractor is running with Jasmine 1.X while your jasmine-reporters' version is 2.X. Try to downgrade jasmine reporter to 1.1.0 may solve your problem.
I am using Jenkins (Hudson) with the Grails plugin to do builds as I update svn. I found this example script that allows you to incorporate a build number from an env var:
set-version 1.1.0.${env['BUILD_NUMBER']}
But as you see, the prefix is hard-coded. I'd like to use the version number set in the application.properties file. How can I do something like:
set-version ${app.version}.${env['BUILD_NUMBER']}
Have tried a variety of scopes/syntax to no avail.
It is not possible out of the box. Jenkins or specifically the Grails plugin does not read the content of the application.properties file and hence the existing application version is not available as a variable.
You might want to consider writing a custom script in your application (like append-version) that will read application.properties and append the value passed in. You can call the existing set-version script modifying the argument.
I have also created a simple script that should do the job:
includeTargets << grailsScript("Init")
target(main: "Append a string to the existing version number") {
depends(checkVersion, parseArguments)
def newVersion = metadata.'app.version' + '-' + args
metadata.'app.version' = newVersion
metadata.persist()
}
setDefaultTarget(main)