Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Buddy.works support
Browse files Browse the repository at this point in the history
  • Loading branch information
wbeuil committed Apr 1, 2020
1 parent ac57e52 commit 8ee8a33
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SHA1SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c03d34fc54383953b7a03ae7fcc6dec0990d76a7 codecov
8fbba975dccd40ae06704bcea67b70bb3f8e919d codecov
15 changes: 15 additions & 0 deletions codecov
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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}"
Expand Down
12 changes: 12 additions & 0 deletions env
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions tests/env
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
12 changes: 12 additions & 0 deletions tests/test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8ee8a33

Please sign in to comment.