diff --git a/SHA1SUM b/SHA1SUM index b9ebd2e6..f68c882f 100644 --- a/SHA1SUM +++ b/SHA1SUM @@ -1 +1 @@ -c03d34fc54383953b7a03ae7fcc6dec0990d76a7 codecov +8fbba975dccd40ae06704bcea67b70bb3f8e919d codecov diff --git a/codecov b/codecov index 1ae3fed6..25e8d74e 100755 --- a/codecov +++ b/codecov @@ -816,6 +816,20 @@ then then commit=$(git rev-parse "$BITBUCKET_COMMIT") fi + +elif [ "$CI" = "true" ] && [ "$BUDDY" = "true" ]; +then + say "$e==>$x Buddy CI detected." + # https://buddy.works/docs/pipelines/environment-variables + service="buddy" + branch="$BUDDY_EXECUTION_BRANCH" + build="$BUDDY_EXECUTION_ID" + build_url=$(urlencode "$BUDDY_EXECUTION_URL") + commit="$BUDDY_EXECUTION_REVISION" + pr="$BUDDY_EXECUTION_PULL_REQUEST_NO" + tag="$BUDDY_EXECUTION_TAG" + slug="$BUDDY_REPO_SLUG" + elif [ "$CIRRUS_CI" != "" ]; then say "$e==>$x Cirrus CI detected." @@ -827,6 +841,7 @@ then commit="$CIRRUS_CHANGE_IN_REPO" build="$CIRRUS_TASK_ID" job="$CIRRUS_TASK_NAME" + else say "${r}x>${x} No CI provider detected." say " Testing inside Docker? ${b}http://docs.codecov.io/docs/testing-with-docker${x}" diff --git a/env b/env index ef0f120a..092e7a76 100755 --- a/env +++ b/env @@ -250,4 +250,16 @@ then add "BITBUCKET_PR_ID" add "BITBUCKET_COMMIT" +elif [ "$CI" = "true" ] && [ "$BUDDY" = "true" ]; +then + add "CI" + add "BUDDY" + add "BUDDY_EXECUTION_BRANCH" + add "BUDDY_EXECUTION_REVISION" + add "BUDDY_EXECUTION_ID" + add "BUDDY_EXECUTION_URL" + add "BUDDY_EXECUTION_PULL_REQUEST_NO" + add "BUDDY_EXECUTION_TAG" + add "BUDDY_REPO_SLUG" + fi diff --git a/tests/env b/tests/env index 7ee2c7c0..2fae3d64 100644 --- a/tests/env +++ b/tests/env @@ -121,3 +121,11 @@ export CODEBUILD_RESOLVED_SOURCE_VERSION="" export CODEBUILD_SOURCE_VERSION="" export CODEBUILD_BUILD_ID="" export CODEBUILD_SOURCE_REPO_URL="" +export BUDDY="" +export BUDDY_EXECUTION_BRANCH="" +export BUDDY_EXECUTION_REVISION="" +export BUDDY_EXECUTION_ID="" +export BUDDY_EXECUTION_URL="" +export BUDDY_EXECUTION_PULL_REQUEST_NO="" +export BUDDY_EXECUTION_TAG="" +export BUDDY_REPO_SLUG="" \ No newline at end of file diff --git a/tests/test b/tests/test index 54d6a3cc..b3b23b7c 100755 --- a/tests/test +++ b/tests/test @@ -540,6 +540,18 @@ function test_bitbucket_pull_request() { assertTrue 'Expected output differs.' $? } +function test_buddy () { + reset + export CI="true" + export BUDDY="true" + export BUDDY_EXECUTION_BRANCH="master" + export BUDDY_EXECUTION_REVISION="$TEST_DATA_GIT_COMMIT" + export BUDDY_EXECUTION_ID="1" + export BUDDY_EXECUTION_PULL_REQUEST_NO="1" + export BUDDY_REPO_SLUG="codecov/ci-repo" + assertURL "https://codecov.io/upload/v4?package=bash-tbd&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=1&build_url=&name=&tag=&slug=codecov%2Fci-repo&service=buddy&flags=&pr=1&job=" +} + function test_cirrus () { reset export CIRRUS_CI="true"