This repository was archived by the owner on Jan 10, 2023. It is now read-only.
File tree 3 files changed +55
-0
lines changed
3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var services = {
2
2
travis : require ( './services/travis' ) ,
3
3
circle : require ( './services/circle' ) ,
4
4
buildkite : require ( './services/buildkite' ) ,
5
+ azurePipelines : require ( './services/azurePipelines' ) ,
5
6
codeship : require ( './services/codeship' ) ,
6
7
drone : require ( './services/drone' ) ,
7
8
appveyor : require ( './services/appveyor' ) ,
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ detect : function ( ) {
3
+ return ! ! process . env . TF_BUILD
4
+ } ,
5
+
6
+ configuration : function ( ) {
7
+ console . log ( ' Azure Pipelines CI Detected' )
8
+ return {
9
+ service : 'azure_pipelines' ,
10
+ commit : process . env . BUILD_SOURCEVERSION ,
11
+ branch : process . env . BUILD_SOURCEBRANCH ,
12
+ pr : process . env . SYSTEM_PULLREQUEST_PULLREQUESTNUMBER ,
13
+ job : process . env . SYSTEM_JOBID ,
14
+ build : process . env . BUILD_BUILDID ,
15
+ build_url :
16
+ process . env . SYSTEM_TEAMFOUNDATIONSERVERURI +
17
+ process . env . SYSTEM_TEAMPROJECT +
18
+ '/_build/results?buildId=' +
19
+ process . env . BUILD_BUILDID ,
20
+ slug : process . env . BUILD_REPOSITORY_ID ,
21
+ }
22
+ } ,
23
+ }
Original file line number Diff line number Diff line change
1
+ var azurePipelines = require ( '../../lib/services/azurePipelines' )
2
+
3
+ describe ( 'Azure Pipelines CI Provider' , function ( ) {
4
+ it ( 'can detect azure pipelines' , function ( ) {
5
+ process . env . TF_BUILD = '1'
6
+ expect ( azurePipelines . detect ( ) ) . to . be ( true )
7
+ } )
8
+
9
+ it ( 'can get azure pipelines env info' , function ( ) {
10
+ process . env . BUILD_SOURCEBRANCH = 'master'
11
+ process . env . SYSTEM_JOBID = '92a2fa25-f940-5df6-a185-81eb9ae2031d'
12
+ process . env . BUILD_BUILDID = '1'
13
+ process . env . SYSTEM_TEAMFOUNDATIONSERVERURI =
14
+ 'https://dev.azure.com/codecov/'
15
+ process . env . SYSTEM_TEAMPROJECT = 'repo'
16
+ process . env . BUILD_SOURCEVERSION = '743b04806ea677403aa2ff26c6bdeb85005de658'
17
+ process . env . BUILD_REPOSITORY_ID = 'owner/repo'
18
+ process . env . SYSTEM_PULLREQUEST_PULLREQUESTNUMBER = '1234'
19
+
20
+ expect ( azurePipelines . configuration ( ) ) . to . eql ( {
21
+ service : 'azure_pipelines' ,
22
+ build : '1' ,
23
+ build_url : 'https://dev.azure.com/codecov/repo/_build/results?buildId=1' ,
24
+ job : '92a2fa25-f940-5df6-a185-81eb9ae2031d' ,
25
+ commit : '743b04806ea677403aa2ff26c6bdeb85005de658' ,
26
+ pr : '1234' ,
27
+ branch : 'master' ,
28
+ slug : 'owner/repo' ,
29
+ } )
30
+ } )
31
+ } )
You can’t perform that action at this time.
0 commit comments