Skip to content

Commit f0fecdb

Browse files
authored
rename Visual Studio Team Services to Azure Pipelines (#135)
BREAKING CHANGE: the `vsts` service name is now `azurePipelines`
1 parent 5733594 commit f0fecdb

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ if (isCI) {
6565
| CI Service (`name`) | `service` | `isCi` | `branch` | `commit` | `tag` | `build` | `buildUrl` | `job` | `jobUrl` | `isPr` | `pr` | `prBranch` | `slug` | `root` |
6666
| -------------------------------------------------------------------------------------------------------------------------------------- | :-----------: | :----------------: | :-------------------------: | :----------------: | :---------------------: | :----------------: | :----------------: | :----------------: | :----------------: | :-------------------: | :-------------------: | :-------------------: | :----------------: | :----------------: |
6767
| [AppVeyor](https://www.appveyor.com/docs/environment-variables) | `appveyor` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
68+
| [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables) | `azure-devops`| :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
6869
| [Bamboo](https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html) | `bamboo` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: |
6970
| [Bitbucket](https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html) | `bitbucket` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: |
7071
| [Bitrise](https://devcenter.bitrise.io/builds/available-environment-variables/#exposed-by-bitriseio) | `bitrise` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
@@ -90,7 +91,6 @@ if (isCI) {
9091
| [Travis CI](https://docs.travis-ci.com/user/environment-variables#default-environment-variables) | `travis` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
9192
| [Vela](https://go-vela.github.io/docs/reference/environment/variables/) | `vela` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
9293
| [Vercel](https://vercel.com/docs/environment-variables) | `vercel` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
93-
| [Visual Studio Team Services](https://docs.microsoft.com/en-us/vsts/pipelines/build/variables) | `vsts` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
9494
| [Wercker](http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name) | `wercker` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: |
9595

9696
:warning: See [Caveats](#caveats)

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const git = require('./services/git.js');
33

44
const services = {
55
appveyor: require('./services/appveyor.js'),
6+
azurePipelines: require('./services/azure-pipelines.js'),
67
bamboo: require('./services/bamboo.js'),
78
bitbucket: require('./services/bitbucket.js'),
89
bitrise: require('./services/bitrise.js'),
@@ -28,7 +29,6 @@ const services = {
2829
travis: require('./services/travis.js'),
2930
vela: require('./services/vela.js'),
3031
vercel: require('./services/vercel.js'),
31-
vsts: require('./services/vsts.js'),
3232
wercker: require('./services/wercker.js'),
3333
};
3434

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"homepage": "https://github.com/semantic-release/env-ci#readme",
3737
"keywords": [
3838
"appveyor",
39+
"azure-pipelines",
3940
"bamboo",
4041
"bitbucket",
4142
"bitrise",
@@ -63,7 +64,6 @@
6364
"teamcity",
6465
"travis",
6566
"variable",
66-
"vsts",
6767
"wercker"
6868
],
6969
"license": "MIT",

services/vsts.js renamed to services/azure-pipelines.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://docs.microsoft.com/en-us/vsts/pipelines/build/variables
1+
// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables
22
// The docs indicate that SYSTEM_PULLREQUEST_SOURCEBRANCH and SYSTEM_PULLREQUEST_TARGETBRANCH are in the long format (e.g `refs/heads/master`) however tests show they are both in the short format (e.g. `master`)
33
const {parseBranch} = require('../lib/utils.js');
44

@@ -11,8 +11,8 @@ module.exports = {
1111
const isPr = Boolean(pr);
1212

1313
return {
14-
name: 'Visual Studio Team Services',
15-
service: 'vsts',
14+
name: 'Azure Pipelines',
15+
service: 'azurePipelines',
1616
commit: env.BUILD_SOURCEVERSION,
1717
build: env.BUILD_BUILDNUMBER,
1818
branch: parseBranch(isPr ? env.SYSTEM_PULLREQUEST_TARGETBRANCH : env.BUILD_SOURCEBRANCH),

test/index.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ test('Appveyor', (t) => {
1212
t.is(service, 'appveyor');
1313
});
1414

15+
test('Azure Pipelines', (t) => {
16+
const {isCi, service} = m({env: {BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts'}});
17+
18+
t.is(isCi, true);
19+
t.is(service, 'azurePipelines');
20+
});
21+
1522
test('Bamboo', (t) => {
1623
const {isCi, service} = m({env: {bamboo_agentId: 'some bamboo agent id'}}); // eslint-disable-line camelcase
1724

@@ -172,13 +179,6 @@ test('Vela', (t) => {
172179
t.is(service, 'vela');
173180
});
174181

175-
test('Visual Studio Team Services', (t) => {
176-
const {isCi, service} = m({env: {BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts'}});
177-
178-
t.is(isCi, true);
179-
t.is(service, 'vsts');
180-
});
181-
182182
test('Wercker', (t) => {
183183
const {isCi, service} = m({env: {WERCKER_MAIN_PIPELINE_STARTED: '123456'}});
184184

test/services/vsts.test.js renamed to test/services/azure-pipelines.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const test = require('ava');
2-
const vsts = require('../../services/vsts.js');
2+
const azurePipelines = require('../../services/azure-pipelines.js');
33

44
const env = {
55
BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts',
@@ -10,9 +10,9 @@ const env = {
1010
};
1111

1212
test('Push', (t) => {
13-
t.deepEqual(vsts.configuration({env}), {
14-
name: 'Visual Studio Team Services',
15-
service: 'vsts',
13+
t.deepEqual(azurePipelines.configuration({env}), {
14+
name: 'Azure Pipelines',
15+
service: 'azurePipelines',
1616
commit: '5678',
1717
build: '1234',
1818
branch: 'master',
@@ -24,9 +24,9 @@ test('Push', (t) => {
2424
});
2525

2626
test('Push - with long branch name', (t) => {
27-
t.deepEqual(vsts.configuration({env: {...env, BUILD_SOURCEBRANCH: 'refs/heads/master'}}), {
28-
name: 'Visual Studio Team Services',
29-
service: 'vsts',
27+
t.deepEqual(azurePipelines.configuration({env: {...env, BUILD_SOURCEBRANCH: 'refs/heads/master'}}), {
28+
name: 'Azure Pipelines',
29+
service: 'azurePipelines',
3030
commit: '5678',
3131
build: '1234',
3232
branch: 'master',
@@ -39,7 +39,7 @@ test('Push - with long branch name', (t) => {
3939

4040
test('PR', (t) => {
4141
t.deepEqual(
42-
vsts.configuration({
42+
azurePipelines.configuration({
4343
env: {
4444
...env,
4545
SYSTEM_PULLREQUEST_PULLREQUESTID: '9',
@@ -48,8 +48,8 @@ test('PR', (t) => {
4848
},
4949
}),
5050
{
51-
name: 'Visual Studio Team Services',
52-
service: 'vsts',
51+
name: 'Azure Pipelines',
52+
service: 'azurePipelines',
5353
commit: '5678',
5454
build: '1234',
5555
branch: 'master',

0 commit comments

Comments
 (0)