Skip to content

Commit

Permalink
support Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Sep 12, 2019
1 parent 3bf567a commit 7327169
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions codecov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,27 @@ def main(*argv, **kwargs):
if language:
_add_env_if_not_empty(include_env, 'TRAVIS_%s_VERSION' % language.upper())

# ---------------
# Azure Pipelines
# ---------------
elif os.getenv("TF_BUILD") == "True" and os.getenv("SHIPPABLE") != "true":
# https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
# https://docs.microsoft.com/en-us/azure/devops/pipelines/migrate/from-travis?view=azure-devops#predefined-variables
query.update(dict(branch=os.getenv("BUILD_SOURCEBRANCH",
os.getenv("SYSTEM_PULLREQUEST_TARGETBRANCH")),
service="azure_pipelines",
build=os.getenv("AGENT_JOBNAME"),
pr=os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTID",
os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER")),
tag=os.getenv("BUILD_SOURCEBRANCH"),
slug=os.getenv("BUILD_REPOSITORYNAME"),
commit=os.getenv("BUILD_SOURCEVERSION"),
),
)
root = os.getenv("BUILD_SOURCESDIRECTORY") or root
write(" Azure Pipelines Detected")
_add_env_if_not_empty(include_env, "AGENT_OS")

# --------
# Codeship
# --------
Expand Down

0 comments on commit 7327169

Please sign in to comment.