#!/usr/bin/env bash set -e source ci/upload-ci-artifact.sh #shellcheck source=ci/common/shared-functions.sh source ci/common/shared-functions.sh # # Add job_stats data point # if [[ -z $CI_BUILD_START ]]; then echo Error: CI_BUILD_START empty else # make sure console outputs are uploaded as soon as possible, if any ( shopt -s nullglob for console_log in ./intercepted-console-*; do gzip -f "$console_log" upload-ci-artifact "$console_log.gz" done ) CI_BUILD_DURATION=$(( $(date +%s) - CI_BUILD_START + 1 )) CI_LABEL=${BUILDKITE_LABEL:-build label missing} PR=false if [[ $BUILDKITE_BRANCH =~ pull/* ]]; then PR=true fi SUCCESS=true if [[ $BUILDKITE_COMMAND_EXIT_STATUS != 0 ]]; then SUCCESS=false fi if [[ -n $BUILDKITE ]]; then if need_to_upload_test_result; then if [[ -f "results.json" ]]; then # extract lines which start with '{' awk '/{.*/' results.json >sanitized-results.json if [[ -n "$BUILDKITE_ANALYTICS_TOKEN" ]]; then echo "~~~ Uploading test results to Buildkite Analytics" buildkite-test-collector results.xml