diff --git a/README.md b/README.md index 07e19f4..f4970f0 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Officially supported CI servers: | Name | Constant | isPR | | ------------------------------------------------------------------------------- | ----------------------- | ---- | | [Agola CI](https://agola.io/) | `ci.AGOLA` | ✅ | +| [Alpic](https://alpic.ai/) | `ci.ALPIC` | 🚫 | | [Appcircle](https://appcircle.io/) | `ci.APPCIRCLE` | ✅ | | [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ | | [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | ✅ | diff --git a/index.d.ts b/index.d.ts index bf277d8..2ead0b2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -33,6 +33,7 @@ export const id: string | null; /* Vendor constants */ export const AGOLA: boolean; +export const ALPIC: boolean; export const APPCIRCLE: boolean; export const APPVEYOR: boolean; export const CODEBUILD: boolean; diff --git a/test.js b/test.js index ab5ba7e..5500853 100644 --- a/test.js +++ b/test.js @@ -99,6 +99,24 @@ test('Anonymous CI', function (t) { t.end() }) +test('Alpic', function (t) { + process.env.ALPIC_HOST = 'true' + + clearModule('./') + const ci = require('./') + + t.equal(ci.isCI, true) + t.equal(ci.isPR, null) + t.equal(ci.name, 'Alpic') + t.equal(ci.ALPIC, true) + t.equal(ci.id, 'ALPIC') + assertVendorConstants('ALPIC', ci, t) + + delete process.env.ALPIC_HOST + + t.end() +}) + test('AppVeyor - PR', function (t) { process.env.APPVEYOR = 'true' process.env.APPVEYOR_PULL_REQUEST_NUMBER = '42' diff --git a/vendors.json b/vendors.json index 3505e1b..d697afa 100644 --- a/vendors.json +++ b/vendors.json @@ -5,6 +5,11 @@ "env": "AGOLA_GIT_REF", "pr": "AGOLA_PULL_REQUEST_ID" }, + { + "name": "Alpic", + "constant": "ALPIC", + "env": "ALPIC_HOST" + }, { "name": "Appcircle", "constant": "APPCIRCLE",