Ok, this was a good learning.

When running inside a shell that is using 'set -e' to trap errors, and trying to handle an error from a specific command without exiting the shell,  don't do this ...

        ${cmd} "$@" | true
        if [  ${PIPESTATUS[0]} -ne 0 ]; then
            /* handle error */
        fi

This sometimes yields to a ${PIPESTATUS[0]} of 141 if ${cmd} is still writing to stdout when 'true' exits.

Instead use 'tee' to consume (and display) everything ${cmd} sends to stdout.  As in ...

        ${cmd} "$@" | tee /dev/null
        if [  ${PIPESTATUS[0]} -ne 0 ]; then
            /* handle error */
        fi

Triggering another build.

Scott

On 2020-10-23 4:23 a.m., build.starlingx@gmail.com wrote:
Project: STX_publish
Build #: 1777
Status: Still Failing
Timestamp: 20201023T080158Z

Check logs at:
http://mirror.starlingx.cengn.ca/mirror/starlingx/master/centos/monolithic/20201023T043000Z/logs
--------------------------------------------------------------------------------
Parameters

MY_WORKSPACE: /localdisk/loadbuild/jenkins/master/20201023T043000Z
OS: centos
PUBLISH_LOGS_URL: http://mirror.starlingx.cengn.ca/mirror/starlingx/master/centos/monolithic/20201023T043000Z/logs
RETRIES: 5
PUBLISH_LOGS_BASE: /export/mirror/starlingx/master/centos/monolithic/20201023T043000Z/logs
MASTER_JOB_NAME: STX_build_master_master
RETRY_INTERVAL_SEC: 300
MY_REPO_ROOT: /localdisk/designer/jenkins/master
PUBLISH_DISTRO_BASE: /export/mirror/starlingx/master/centos/monolithic
TIMESTAMP: 20201023T043000Z
PUBLISH_INPUTS_BASE: /export/mirror/starlingx/master/centos/monolithic/20201023T043000Z/inputs
LAYER: 
PUBLISH_OUTPUTS_BASE: /export/mirror/starlingx/master/centos/monolithic/20201023T043000Z/outputs

_______________________________________________
Starlingx-discuss mailing list
Starlingx-discuss@lists.starlingx.io
http://lists.starlingx.io/cgi-bin/mailman/listinfo/starlingx-discuss