Skip to content

Commit

Permalink
rename Visual Studio Team Services to Azure Pipelines (#135)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `vsts` service name is now `azurePipelines`
  • Loading branch information
travi committed Dec 3, 2021
1 parent 5733594 commit f0fecdb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ if (isCI) {
| CI Service (`name`) | `service` | `isCi` | `branch` | `commit` | `tag` | `build` | `buildUrl` | `job` | `jobUrl` | `isPr` | `pr` | `prBranch` | `slug` | `root` |
| -------------------------------------------------------------------------------------------------------------------------------------- | :-----------: | :----------------: | :-------------------------: | :----------------: | :---------------------: | :----------------: | :----------------: | :----------------: | :----------------: | :-------------------: | :-------------------: | :-------------------: | :----------------: | :----------------: |
| [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: |
| [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: |
| [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: |
| [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: |
| [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: |
Expand All @@ -90,7 +91,6 @@ if (isCI) {
| [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: |
| [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: |
| [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: |
| [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: |
| [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: |

:warning: See [Caveats](#caveats)
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const git = require('./services/git.js');

const services = {
appveyor: require('./services/appveyor.js'),
azurePipelines: require('./services/azure-pipelines.js'),
bamboo: require('./services/bamboo.js'),
bitbucket: require('./services/bitbucket.js'),
bitrise: require('./services/bitrise.js'),
Expand All @@ -28,7 +29,6 @@ const services = {
travis: require('./services/travis.js'),
vela: require('./services/vela.js'),
vercel: require('./services/vercel.js'),
vsts: require('./services/vsts.js'),
wercker: require('./services/wercker.js'),
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"homepage": "https://github.com/semantic-release/env-ci#readme",
"keywords": [
"appveyor",
"azure-pipelines",
"bamboo",
"bitbucket",
"bitrise",
Expand Down Expand Up @@ -63,7 +64,6 @@
"teamcity",
"travis",
"variable",
"vsts",
"wercker"
],
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions services/vsts.js → services/azure-pipelines.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://docs.microsoft.com/en-us/vsts/pipelines/build/variables
// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables
// 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`)
const {parseBranch} = require('../lib/utils.js');

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

return {
name: 'Visual Studio Team Services',
service: 'vsts',
name: 'Azure Pipelines',
service: 'azurePipelines',
commit: env.BUILD_SOURCEVERSION,
build: env.BUILD_BUILDNUMBER,
branch: parseBranch(isPr ? env.SYSTEM_PULLREQUEST_TARGETBRANCH : env.BUILD_SOURCEBRANCH),
Expand Down
14 changes: 7 additions & 7 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ test('Appveyor', (t) => {
t.is(service, 'appveyor');
});

test('Azure Pipelines', (t) => {
const {isCi, service} = m({env: {BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts'}});

t.is(isCi, true);
t.is(service, 'azurePipelines');
});

test('Bamboo', (t) => {
const {isCi, service} = m({env: {bamboo_agentId: 'some bamboo agent id'}}); // eslint-disable-line camelcase

Expand Down Expand Up @@ -172,13 +179,6 @@ test('Vela', (t) => {
t.is(service, 'vela');
});

test('Visual Studio Team Services', (t) => {
const {isCi, service} = m({env: {BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts'}});

t.is(isCi, true);
t.is(service, 'vsts');
});

test('Wercker', (t) => {
const {isCi, service} = m({env: {WERCKER_MAIN_PIPELINE_STARTED: '123456'}});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const test = require('ava');
const vsts = require('../../services/vsts.js');
const azurePipelines = require('../../services/azure-pipelines.js');

const env = {
BUILD_BUILDURI: 'https://fabrikamfiber.visualstudio.com/_git/Scripts',
Expand All @@ -10,9 +10,9 @@ const env = {
};

test('Push', (t) => {
t.deepEqual(vsts.configuration({env}), {
name: 'Visual Studio Team Services',
service: 'vsts',
t.deepEqual(azurePipelines.configuration({env}), {
name: 'Azure Pipelines',
service: 'azurePipelines',
commit: '5678',
build: '1234',
branch: 'master',
Expand All @@ -24,9 +24,9 @@ test('Push', (t) => {
});

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

test('PR', (t) => {
t.deepEqual(
vsts.configuration({
azurePipelines.configuration({
env: {
...env,
SYSTEM_PULLREQUEST_PULLREQUESTID: '9',
Expand All @@ -48,8 +48,8 @@ test('PR', (t) => {
},
}),
{
name: 'Visual Studio Team Services',
service: 'vsts',
name: 'Azure Pipelines',
service: 'azurePipelines',
commit: '5678',
build: '1234',
branch: 'master',
Expand Down

0 comments on commit f0fecdb

Please sign in to comment.