Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is done with the ACLI combining actions from the BCLI and the SLACKCLI. Requires Version 9.2 or higher.

Steps

StepDescription
Identify critical builds

Focus on the most critical builds that need timely attention. There are multiple ways to specify what build plans should be included in the report.

  1. Simple list of plan keys (fully qualified by project)
  2. Simple list of plan keys in a specific project
  3. Plans in a project with regex and other filtering criteria
Code Block
titleExample
acli bamboo.examplegear -a getBuildReportList --project EXAMPLE --list PLAN1,PLAN2,PLAN3 --field notState=UNKNOWN -f @temp 


Choose columns to report

Select the minimum columns needed. getBuildReportList already minimizes the columns reported. In this example

with

, we want a very targeted report, we remove the first 3 columns.

Code Block
... --columns -1,2,3


Choose a date format

Specify a date format that best matches specific needs

and being concise 

. We use a very concise to minimize line length. 

Code Block
... --dateFormat "EEE HH:mm"


Modify data

Format the data

to

for the report. In this example, we are going to report as a text table, without wrapping, and with modified test result headings to minimize line

length 

length. A text table looks best in Slack. 

Code Block
acli
csv -a copyCsv --sourceFile @temp --outputType text --headingAugments ",,Succ,Fail,Skip,Quar" --options screenwidth=999


Send to SlackAssume

Assumes you already have a slack

configured for acli with appropriate token

token, acli configured to use the token, and access granted

for

to allow the CLI to send to your channel

  • See 
"slack_appfire -a sendMessage --channel

- see Access Tokens.

We are using markdown code format to get fixed width lines with active links to click on the url to get to the build quickly.

Code Block
slack -a sendMessage --channel ${bamboo.channel} -f @temp --options markdown=code


Full Example

We use a Bamboo plan with a script task. This assumes acli is on the path and configured appropriately to access the servers needed. This example uses linux style escaping. We use the CLI temp file for automatically handling of file output 

Code Block
acli -a run \
  -i "bamboo.examplegear -a getBuildReportList --project EXAMPLE --list PLAN1,PLAN2,PLAN3 -f @temp --field notState=UNKNOWN --dateFormat \"EEE HH:mm\" --columns -1,2,3" \
  -i "csv -a convertCsv --sourceFile @temp -f @temp --outputType text --headingAugments \",,Succ,Fail,Skip,Quar\" --options screenwidth=999 " \
  -i "slack -a sendMessage --channel ${bamboo.channel} -f @temp --options markdown=code " \