@@ -505,6 +505,7 @@ def main(*argv, **kwargs):
505
505
506
506
else :
507
507
write ("==> Detecting CI provider" )
508
+
508
509
# -------
509
510
# Jenkins
510
511
# -------
@@ -845,6 +846,39 @@ def main(*argv, **kwargs):
845
846
846
847
write (" GitHub Actions CI Detected" )
847
848
849
+ # -------
850
+ # Azure Pipelines
851
+ # -------
852
+ elif os .getenv ("SYSTEM_TEAMFOUNDATIONSERVERURI" ):
853
+ # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts
854
+ # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml
855
+ # https://github.com/codecov/codecov-bash/blob/ce0eb066b997622ff071255e8aa4c239099c17fc/codecov#L895
856
+ query .update (
857
+ dict (
858
+ service = "azure_pipelines" ,
859
+ commit = os .getenv ("BUILD_SOURCEVERSION" ),
860
+ build = os .getenv ("BUILD_BUILDNUMBER" ),
861
+ project = os .getenv ("SYSTEM_TEAMPROJECT" ),
862
+ server_uri = os .getenv ("SYSTEM_TEAMFOUNDATIONSERVERURI" ),
863
+ job = os .getenv ("BUILD_BUILDID" ),
864
+ branch = os .getenv ("BUILD_SOURCEBRANCH" , "" ).replace ("refs/heads/" , "" ),
865
+ build_url = "" .join ([
866
+ os .getenv ("SYSTEM_TEAMFOUNDATIONSERVERURI" , "" ),
867
+ os .getenv ("SYSTEM_TEAMPROJECT" , "" ),
868
+ "/_build/results?buildId=" ,
869
+ os .getenv ("BUILD_BUILDID" , "" )
870
+ ])
871
+ )
872
+ )
873
+
874
+ if os .getenv ("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ):
875
+ query .update (dict (pr = os .getenv ("SYSTEM_PULLREQUEST_PULLREQUESTID" )))
876
+ else :
877
+ query .update (dict (pr = os .getenv ("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" )))
878
+
879
+ root = os .getenv ("BUILD_SOURCESDIRECTORY" ) or root
880
+ write (" Azure Pipelines detected" )
881
+
848
882
else :
849
883
query .update (
850
884
dict (
0 commit comments