Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit f6cd01a

Browse files
author
Steve Peak
authored
Merge pull request #126 from duvholt/drone-env
Update Drone environment variables
2 parents 23af5bb + aaba928 commit f6cd01a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

codecov/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,12 @@ def main(*argv, **kwargs):
380380
# --------
381381
# drone.io
382382
# --------
383-
elif os.getenv('CI') == "true" and os.getenv('DRONE') == "true":
383+
elif os.getenv('CI') == "drone" and os.getenv('DRONE') == "true":
384384
# http://docs.drone.io/env.html
385385
query.update(dict(branch=os.getenv('DRONE_BRANCH'),
386386
service='drone.io',
387387
build=os.getenv('DRONE_BUILD_NUMBER'),
388-
build_url=os.getenv('DRONE_BUILD_URL')))
388+
build_url=os.getenv('DRONE_BUILD_LINK')))
389389
root = os.getenv('DRONE_BUILD_DIR') or root
390390
write(' Drone Detected')
391391

tests/test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def setUp(self):
4141
"BUILDKITE", "BUILDKITE_BUILD_NUMBER", "BUILDKITE_JOB_ID", "BUILDKITE_BRANCH", "BUILDKITE_PROJECT_SLUG", "BUILDKITE_COMMIT",
4242
"DRONE", "DRONE_BRANCH", "DRONE_BUILD_DIR", "JENKINS_URL", "TRAVIS_TAG",
4343
"GIT_BRANCH", "GIT_COMMIT", "WORKSPACE", "BUILD_NUMBER", "CI_BUILD_URL", "SEMAPHORE_REPO_SLUG", "SEMAPHORE_CURRENT_THREAD",
44-
"DRONE_BUILD_URL", "TRAVIS_REPO_SLUG", "CODECOV_TOKEN", "APPVEYOR", "APPVEYOR_REPO_BRANCH",
44+
"DRONE_BUILD_LINK", "TRAVIS_REPO_SLUG", "CODECOV_TOKEN", "APPVEYOR", "APPVEYOR_REPO_BRANCH",
4545
"APPVEYOR_BUILD_VERSION", "APPVEYOR_JOB_ID", "APPVEYOR_REPO_NAME", "APPVEYOR_REPO_COMMIT", "WERCKER_GIT_BRANCH",
4646
"WERCKER_MAIN_PIPELINE_STARTED", "WERCKER_GIT_OWNER", "WERCKER_GIT_REPOSITORY",
4747
"CI_BUILD_REF_NAME", "CI_BUILD_ID", "CI_BUILD_REPO", "CI_PROJECT_DIR", "CI_BUILD_REF", "CI_SERVER_NAME",
@@ -445,10 +445,11 @@ def test_ci_semaphore(self):
445445
self.assertEqual(res['query']['branch'], 'master')
446446

447447
def test_ci_drone(self):
448-
self.set_env(DRONE='true',
448+
self.set_env(CI='drone',
449+
DRONE='true',
449450
DRONE_BUILD_NUMBER='10',
450451
DRONE_BRANCH='master',
451-
DRONE_BUILD_URL='https://drone.io/github/builds/1',
452+
DRONE_BUILD_LINK='https://drone.io/github/builds/1',
452453
CODECOV_TOKEN='token')
453454
self.fake_report()
454455
res = self.run_cli()

0 commit comments

Comments
 (0)