Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
feat: add build number env vars for compatibility with drone and othe…
Browse files Browse the repository at this point in the history
…r CI systems

s updating readme

s updating readme
  • Loading branch information
jackspirou committed Feb 8, 2016
1 parent 4332e58 commit 054b8d4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ List of iOS simulators you can test on:
- `device: 'iPhone 5', 'os_version': '6.0'`
- `device: 'iPhone 5S', 'os_version': '7.0'`

### CI/CD Build Environment Variables

Many CI/CD systems will make the name or ID of the currently running build available via an environment variable. The follow environment variables below are supported by default:

* `process.env.BUILD_NUMBER`
* `process.env.BUILD_TAG`
* `process.env.CI_BUILD_NUMBER`
* `process.env.CI_BUILD_TAG`
* `process.env.TRAVIS_BUILD_NUMBER`
* `process.env.CIRCLE_BUILD_NUM`
* `process.env.DRONE_BUILD_NUMBER`

---

[BrowserStack's REST API documentation](https://www.browserstack.com/automate/rest-api#rest-api-browsers)
Expand Down
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ var BrowserStackBrowser = function (id, emitter, args, logger,
timeout: bsConfig.timeout || 300,
project: bsConfig.project,
name: bsConfig.name || 'Karma test',
build: bsConfig.build || process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER ||
process.env.BUILD_TAG || process.env.CIRCLE_BUILD_NUM || null
build: bsConfig.build ||
process.env.BUILD_NUMBER ||
process.env.BUILD_TAG ||
process.env.CI_BUILD_NUMBER ||
process.env.CI_BUILD_TAG ||
process.env.TRAVIS_BUILD_NUMBER ||
process.env.CIRCLE_BUILD_NUM ||
process.env.DRONE_BUILD_NUMBER || null
}

if (typeof args.real_mobile !== 'undefined') {
Expand Down

0 comments on commit 054b8d4

Please sign in to comment.