Versions Compared

Key

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

...

Append data from other projects or servers


Code Block
languagebash
themeMidnight
titleExample
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 "bamboo2.examplegear -a getBuildReportList --project EXAMPLE2 --regex PLAN.* -f @temp --append --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 "


Show where report came from

Add the following to your script if you are running it from Bamboo

Code Block
languagebash
themeMidnight
# Show where the message comes from - this build! This makes it easy to re-run the report after the problems have been fixed:    
acli slack -a sendMessage --channel ${bamboo.channel} --content '[{"type": "context","elements": [{"type": "mrkdwn","text": "Reported from ${bamboo.resultsUrl}"}]}]'

Result

Code Block
languagetext
Reported from https://bamboo.examplegear.com/browse/ADMIN-BUILDSTATUS-JOB1-3


Use script variables

When running from a Bamboo using a script, you can use simple scripting to help standardize the acli action across multiple builds for similar reports. This highlights the key differences and makes it easier to read.

Code Block
languagebash
themeMidnight
titleExample
linenumberstrue
#!/bin/bash -x
set -e  # error on failure

site=bamboo.examplegear
list=EXAMPLE-NIGHTLY,EXAMPLE-JIRAACCESSCHECK,EXAMPLE2-UNKNOWNLINKS,EXAMPLE2-BUILDSTATUS,EXAMPLE2-DEVOPS


acli -a run \
  -i "${site} -a getBuildReportList --list ${list} -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 "


# Show where the message comes from - this build! This makes it easy to re-run the report after the problems have been fixed:
acli slack -a sendMessage --channel ${bamboo.channel} --content '[{"type": "context","elements": [{"type": "mrkdwn","text": "Reported from ${bamboo.resultsUrl}"}]}]'


...