Bamboo - return custom messages and error codes. - bamboo

From the looks of it, Bamboo only returns a 0 or 1 if a script fails or succeeds. Is it possible to add any customization at all in order to get more information on why a script failed?
I have a script that builds several repositories and would like very detailed information on any failures that may occur (which repo failed, why, etc.).
Is there any way to handle this through Bamboo? I can create a log file that outputs the data I want, but if possible I would like to see any issues through Bamboo OR the Bamboo email that can be sent whenever a failure occurs. Is there a way to customize the email to include text from a text file (my log file)?

Bamboo expects exit 0 for a successful execution. Anything else results in a failure. However, this exit code is listed in the respective build log like below.
simple 14-Aug-2017 14:59:29 Failing task since return code of [mvn clean package] was 1 while expected 0
If you want the log snip to be sent in the email, you can just customise the Email notification template in WEB-INF/classes/notification-templates/. Some content in notifications can be configured via system properties, such as the number of log lines to include in email notifications that display log information.
Hope that helps.

Related

How can I run some code in the event that a watched folder does not exist?

I have a Mule 4 flow that uses the [File] On New or Updated File event source. This element is configured to wait for file changes within a specific folder.
When I deploy my flow, and the deployed application does not have access to the specified folder, a log message is generated and the flow terminates. However, I'd like to add some additional processing in this case. (I'd like to log a message to an alternative event log).
I tried adding an On Error Propagate element to the flow, but this is not triggered when the error occurs - I think this is because the error is a system error rather than a messaging error.
If I could add a step before the On New or Updated File element, then I could check for the existence of the folder, and execute that extra code there - but I see no way to do that either.
Well, I was able to do something that "works". I created another flow that runs on a (long) timer, which runs immediately and checks for the existence of the folder by attempting to list its contents. If that fails, then the On Error ... block of that flow is reached, because in this case the error is treated as a messaging error rather than a system error.
Not an ideal solution, but a solution nonetheless.
May I suggest that you monitor folder which should contain none existing folder?
For exmple you want to monitor /one/two/three/abc.txt. three does not exist. Watch two for new and updated files.

How to send the test count displayed at the end of the Jenkins log in email body after test execution?

I am using Maven surefire plugin to trigger testcase's from Jenkins, once the execution is done a report is getting generated at the same time at the end of the build log, I can see the no off passed, failed and skipped tests.
I want to take this number and send it in the email body form Jenkins. I could be able to send the whole log, but how to read only the pass, fail or skipped count?
Also I would like to read the generated HTML report summary and send it in the email body.

ZAP: Execute Script

I try to execute the community script "Extender/HTTP Message Logger.js". I first double click on the script to make it open in the scripting console. However, in the scripting console, the "Execute" button is disabled and I see no other way how to make it run.
What am I missing?
I think you're missing the message beneath the script which says:
Extender scripts add new functionality, including graphical elements
and new API end points.
Enabling a script installs it and disabling a script uninstalls it.
So you just need to enable the script (by right clicking it and selecting 'Enable') and then it will start working.
The actual issue was that I didn't read the script's code carefully: be default the script only logs JSON messages as defined on lines 17 and 43 and following. In order to log all the sent and received HTTP messages, I simply changed the isMessageToLog(log) function to always return true. After redeploying the script (disabling and enabling) it would log all HTTP messages.

Not able to approve tasks in Documentum D2

In one of the workflows, task notification has been sent to an user's inbox. When the user tries to acquire the task, he is getting the error like missing package for the current task of the workflow.
Kindly provide me the suggestion on resolving this issue.
During the Workflow definition if the Package is added as Mandatory Package, and during task completion process if the task attachment is missing, user is expected to get this message in D2 client.
Please check weather the Task attachment is missing from repository in this scenario.
You can either:
Verify if the associated activity definition for the task (from process builder for example) has defined correctly the package/s.
or
Verify if the attached object (document/s or folder/s) to the task exists in repository or the user has at least BROWSE permission on it.
Also, a good idea is to check the D2 app server and JMS logs.

How to display build error messages in TeamCity when using cake build scripts

Having a CI pipeline that is using Teamcity and Octopus deploy and build scripts written with Cake I want to be able to display the error messages that generated by the build script.
Now the message displayed is:
Exit code 1 (new)
In order to be able to see the real error message one must view the build log and parse it.
So, even when using build script, I want to be able to display the build results in overview page and the list of errors like in the following picture:
I know that Cake provides support for integration with TeamCity, but the documentation and examples are not that straightforward.
Ca anyone provide some helpful information regarding this subject?
Cake implements a method to be able to write a build problem
TeamCityProvider​.BuildProblem(string, ​string)
Looking at the source code for this provider, I can determine that this will build up a string to output that conforms to the build script interaction specified in the TeamCity documentation, specifically reporting the build problem
##teamcity[buildProblem description='<description>' identity='<identity>']
by calling BuildProblem("Some message", "Some identity") this will output
##teamcity[buildProblem description='Some Message' identity='Some identity']
TeamCity should then fail the build and display the message as per the documentation;
To fail a build directly from the build script, a build problem has be reported. Build problems appear on the Build Results page and also affect the build status text.
You need to edit the cake build scripts to properly trap the exception and call the above method, so it will write to the output stream correctly.
I can replicate this behaviour using a PowerShell script to write the buildProblem message to the ouput stream
This will then show the very message in the build results on the overview page
Hope this helps