Class: CI
- Inherits:
-
Object
- Object
- CI
- Defined in:
- lib/helpers/ci.rb
Constant Summary collapse
- DEFAULT_BUILD_NO =
'1'
Class Method Summary collapse
- .branch ⇒ Object
- .build_no ⇒ Object
- .commit ⇒ Object
- .repo ⇒ Object
- .tagged_build?(travis_tag = '') ⇒ Boolean
- .version_suffix ⇒ Object
Class Method Details
.branch ⇒ Object
14 15 16 |
# File 'lib/helpers/ci.rb', line 14 def self.branch ENV['TRAVIS_BRANCH'] || ENV['CIRCLE_BRANCH'] end |
.build_no ⇒ Object
10 11 12 |
# File 'lib/helpers/ci.rb', line 10 def self.build_no ENV["TRAVIS_BUILD_NUMBER"] || ENV["CIRCLE_BUILD_NUM"] || DEFAULT_BUILD_NO end |
.commit ⇒ Object
26 27 28 |
# File 'lib/helpers/ci.rb', line 26 def self.commit ENV['TRAVIS_COMMIT'] || ENV['CIRCLE_SHA1'] end |
.repo ⇒ Object
18 19 20 |
# File 'lib/helpers/ci.rb', line 18 def self.repo ENV['TRAVIS_REPO_SLUG'] || ENV['CIRCLE_PROJECT_REPONAME'] end |
.tagged_build?(travis_tag = '') ⇒ Boolean
5 6 7 8 |
# File 'lib/helpers/ci.rb', line 5 def self.tagged_build?(travis_tag='') travis_tag = !travis_tag.empty? ? travis_tag : ENV['TRAVIS_TAG'] || '' !travis_tag.empty? && !(travis_tag == 'EMPTY') #magic default value used by legacy build scripts end |
.version_suffix ⇒ Object
22 23 24 |
# File 'lib/helpers/ci.rb', line 22 def self.version_suffix ENV['VERSION_SUFFIX'] || '' end |