Skip to content

Commit bb13901

Browse files
committed
feat: add Vela CI
1 parent fc243f4 commit bb13901

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Officially supported CI servers:
7676
| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 |
7777
| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 |
7878
| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` ||
79+
| [Vela](https://go-vela.github.io/docs/) | `ci.VELA` ||
7980
| [Vercel](https://vercel.com/) | `ci.VERCEL` ||
8081
| [Visual Studio App Center](https://appcenter.ms/) | `ci.APPCENTER` | 🚫 |
8182
| [Woodpecker](https://woodpecker-ci.org/) | `ci.WOODPECKER` ||

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const STRIDER: boolean;
6969
export const TASKCLUSTER: boolean;
7070
export const TEAMCITY: boolean;
7171
export const TRAVIS: boolean;
72+
export const VELA: boolean;
7273
export const VERCEL: boolean;
7374
export const APPCENTER: boolean;
7475
export const WOODPECKER: boolean;

test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,44 @@ test('Agola CI - PR', function (t) {
970970
t.end()
971971
})
972972

973+
test('Vela', function (t) {
974+
process.env.VELA = 'true'
975+
process.env.VELA_PULL_REQUEST = '2'
976+
977+
clearModule('./')
978+
const ci = require('./')
979+
980+
t.equal(ci.isCI, true)
981+
t.equal(ci.isPR, false)
982+
t.equal(ci.name, 'Vela')
983+
t.equal(ci.VELA, true)
984+
assertVendorConstants('VELA', ci, t)
985+
986+
delete process.env.VELA
987+
delete process.env.VELA_PULL_REQUEST
988+
989+
t.end()
990+
})
991+
992+
test('Vela - PR', function (t) {
993+
process.env.VELA = 'true'
994+
process.env.VELA_PULL_REQUEST = '1'
995+
996+
clearModule('./')
997+
const ci = require('./')
998+
999+
t.equal(ci.isCI, true)
1000+
t.equal(ci.isPR, true)
1001+
t.equal(ci.name, 'Vela')
1002+
t.equal(ci.VELA, true)
1003+
assertVendorConstants('VELA', ci, t)
1004+
1005+
delete process.env.VELA
1006+
delete process.env.VELA_PULL_REQUEST
1007+
1008+
t.end()
1009+
})
1010+
9731011
function assertVendorConstants (expect, ci, t) {
9741012
ci._vendors.forEach(function (constant) {
9751013
let bool = constant === expect

vendors.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@
284284
"ne": "false"
285285
}
286286
},
287+
{
288+
"name": "Vela",
289+
"constant": "VELA",
290+
"env": "VELA",
291+
"pr": {
292+
"VELA_PULL_REQUEST": "1"
293+
}
294+
},
287295
{
288296
"name": "Vercel",
289297
"constant": "VERCEL",

0 commit comments

Comments
 (0)