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
16 17 18 |
# File 'lib/helpers/ci.rb', line 16 def self.branch ENV['TRAVIS_BRANCH'] || ENV['CIRCLE_BRANCH'] end |
.build_no ⇒ Object
12 13 14 |
# File 'lib/helpers/ci.rb', line 12 def self.build_no ENV["TRAVIS_BUILD_NUMBER"] || ENV["CIRCLE_BUILD_NUM"] || DEFAULT_BUILD_NO end |
.commit ⇒ Object
28 29 30 |
# File 'lib/helpers/ci.rb', line 28 def self.commit ENV['TRAVIS_COMMIT'] || ENV['CIRCLE_SHA1'] end |
.repo ⇒ Object
20 21 22 |
# File 'lib/helpers/ci.rb', line 20 def self.repo ENV['TRAVIS_REPO_SLUG'] || ENV['CIRCLE_PROJECT_REPONAME'] end |
.tagged_build?(travis_tag = '') ⇒ Boolean
5 6 7 8 9 10 |
# File 'lib/helpers/ci.rb', line 5 def self.tagged_build?(travis_tag='') p "TRAVIS_TAG=#{ENV['TRAVIS_TAG']}" travis_tag = !travis_tag.empty? ? travis_tag : ENV['TRAVIS_TAG'] || '' p "travis_tag=#{travis_tag}." !travis_tag.empty? && !(travis_tag == 'EMPTY') #magic default value used by legacy build scripts end |
.version_suffix ⇒ Object
24 25 26 |
# File 'lib/helpers/ci.rb', line 24 def self.version_suffix ENV['VERSION_SUFFIX'] || '' end |