Skip to content

Commit

Permalink
feat: add Prow CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Oct 29, 2023
1 parent d6315fc commit 8e6a591
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Officially supported CI servers:
| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 |
| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` ||
| [Nevercode](http://nevercode.io/) | `ci.NEVERCODE` ||
| [Prow](https://docs.prow.k8s.io/) | `ci.PROW` | 🚫 |
| [ReleaseHub](https://releasehub.com/) | `ci.RELEASEHUB` | 🚫 |
| [Render](https://render.com/) | `ci.RENDER` ||
| [Sail CI](https://sail.ci/) | `ci.SAIL` ||
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const LAYERCI: boolean;
export const MAGNUM: boolean;
export const NETLIFY: boolean;
export const NEVERCODE: boolean;
export const PROW: boolean;
export const RELEASEHUB: boolean;
export const RENDER: boolean;
export const SAIL: boolean;
Expand Down
16 changes: 16 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,22 @@ test('Vela - PR', function (t) {
t.end()
})

test('Prow', function (t) {
process.env.PROW_JOB_ID = '123'

clearModule('./')
const ci = require('./')

t.equal(ci.isCI, true)
t.equal(ci.name, 'Prow')
t.equal(ci.PROW, true)
assertVendorConstants('PROW', ci, t)

delete process.env.PROW

t.end()
})

function assertVendorConstants (expect, ci, t) {
ci._vendors.forEach(function (constant) {
let bool = constant === expect
Expand Down
5 changes: 5 additions & 0 deletions vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@
"ne": "false"
}
},
{
"name": "Prow",
"constant": "PROW",
"env": "PROW_JOB_ID"
},
{
"name": "ReleaseHub",
"constant": "RELEASEHUB",
Expand Down

0 comments on commit 8e6a591

Please sign in to comment.