job-cost.sh is gathering data, and if there is an error while doing
this, it should not cause the build to fail. If an error is detected,
it will be caught, a note is printing, and then the function will
simply return.
Issue: IT-22309
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Ibba89d89223599e3ff9b077d036f5036d3252a68
// limitations under the License.
def call() {
- sh(script: libraryResource('shell/job-cost.sh'))
- cost_str = sh(script: "cat $WORKSPACE/archives/cost.csv | cut -d, -f6", returnStdout: true)
+ try {
+ sh(script: libraryResource('shell/job-cost.sh'))
+ cost_str = sh(script: "cat $WORKSPACE/archives/cost.csv | cut -d, -f6", returnStdout: true)
+ } catch(Exception e) {
+ // Failure in job-cost.sh should not affect the rest of the run.
+ println("Exception caught while running job-cost.sh.")
+ return
+ }
lock("${BUILD_TAG}-stack-cost") {
try {