Correctly integrate buildkite with codecov (#7718)

* Correctly integrate buildkite with codecov

* Fix shellcheck...

* Really detect Buildkite
This commit is contained in:
Ryo Onodera
2020-01-10 03:39:33 +09:00
committed by GitHub
parent 0e506a53b5
commit 287995ffdf
2 changed files with 11 additions and 4 deletions

View File

@ -72,10 +72,14 @@ ARGS+=(
--env CI_JOB_ID
--env CI_PULL_REQUEST
--env CI_REPO_SLUG
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
)
# Also propagate environment variables needed for codecov
# https://docs.codecov.io/docs/testing-with-docker#section-codecov-inside-docker
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
CODECOV_ENVS=$(CI=true bash <(curl -s https://codecov.io/env))
if $INTERACTIVE; then
if [[ -n $1 ]]; then
echo
@ -83,8 +87,10 @@ if $INTERACTIVE; then
echo
fi
set -x
exec docker run --interactive --tty "${ARGS[@]}" "$IMAGE" bash
# shellcheck disable=SC2086
exec docker run --interactive --tty "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" bash
fi
set -x
exec docker run "${ARGS[@]}" "$IMAGE" "$@"
# shellcheck disable=SC2086
exec docker run "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" "$@"