I created an after-script to purge CDN files to prevent collision after each build, but if the build itself failed, it would result at the after-script running anyways and it too would fail (since those CDN files were never created).
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
How can I read the pipeline output from the after-script so I could get the last line Finished: FAILURE
and thus know the build went wrong.