CircleCI changed the frontend recently, truncating build output more aggressively to improve performance. As you may or may not know, you can download raw logs for any build step, but that raw log is still capped to 4 MB. Some users have told us this has been an issue for them in debugging, so here’s a workaround in case you find yourself in this situation:
set -o pipefail && run_cmd | tee ~/cmd_full_output cp ~/cmd_full_output $CIRCLE_ARTIFACTS
You’ll want to move those around your
circle.yml as needed.
For the curious, here’s an explanation of the details:
set -o pipefail: Preserve/propagate failure exit codes, since we’re piping the output of whatever command into another. CircleCI relies on unix exit codes to decide if a build step succeeded or failed. This command is necessary to keep my builds marked as a CircleCI failure when a command fails.
tee some_file: Capture the output of the last command and send it to both the file and stdout. It’s still useful to see the output of the file on a build page, and CircleCi kills commands that run for 10 minutes without any output. I use
tee instead of a unix pipe to preserve both behaviors.
cp $CIRCLE_ARTIFACTS: You can save just about any artifact from a build. Not much more to say there!
Hope this helps you in debugging your hairy problems! Please comment if you have any suggestions to improve this little hack.