Class: Fastlane::Actions::CiBuildNumberAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::CiBuildNumberAction
- Defined in:
- lib/fastlane/plugin/versioning/actions/ci_build_number.rb
Class Method Summary collapse
- .authors ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
57 58 59 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 57 def self. ["Siarhei Fedartsou"] end |
.category ⇒ Object
67 68 69 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 67 def self.category :building end |
.description ⇒ Object
49 50 51 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 49 def self.description "Detects current build number defined by CI system" end |
.example_code ⇒ Object
61 62 63 64 65 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 61 def self.example_code [ 'ci_build_number' ] end |
.is_supported?(platform) ⇒ Boolean
53 54 55 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 53 def self.is_supported?(platform) true end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fastlane/plugin/versioning/actions/ci_build_number.rb', line 4 def self.run(params) if ENV.key?('JENKINS_HOME') || ENV.key?('JENKINS_URL') return ENV['BUILD_NUMBER'] end if ENV.key?('TRAVIS') return ENV['TRAVIS_BUILD_NUMBER'] end if ENV.key?('CIRCLECI') return ENV['CIRCLE_BUILD_NUM'] end if ENV.key?('TEAMCITY_VERSION') return ENV['BUILD_NUMBER'] end if ENV.key?('GO_PIPELINE_NAME') return ENV['GO_PIPELINE_COUNTER'] end if ENV.key?('bamboo_buildKey') return ENV['bamboo_buildNumber'] end if ENV.key?('GITLAB_CI') return ENV['CI_JOB_ID'] end if ENV.key?('XCS') return ENV['XCS_INTEGRATION_NUMBER'] end if ENV.key?('BITBUCKET_BUILD_NUMBER') return ENV['BITBUCKET_BUILD_NUMBER'] end if ENV.key?('BUDDYBUILD_BUILD_NUMBER') return ENV['BUDDYBUILD_BUILD_NUMBER'] end UI.error("Cannot detect current CI build number. Use 1 by default.") "1" end |