env_branch 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/README.md +3 -0
- data/changelog.md +10 -0
- data/lib/env_branch/base.rb +6 -0
- data/lib/env_branch/test_helper.rb +4 -0
- data/lib/env_branch/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 273db0da2cdf164e1d8bba261b33cfcd597f0ddf448eae1c39c0754fce6f577d
|
4
|
+
data.tar.gz: 9885fef24d256fb384d28fcb9637b90203bff90516b6d30c39e78b527a66c8c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70d7b9b360e2446ebddefa960ce0df7e41d846625e26ffd27ee6e6d2029f136c6b40eaa6e80537075b249ca7b46fe23b27e9545834bba057117f0ba52ecd8c66
|
7
|
+
data.tar.gz: 7898265b787dabc340460e61e73334e95cfb94c3f538904cdae6309199dfb3634cf261afbc80a139d715f88af35168e00cf8ea00cea7bd5e50ec6d11f91afe25
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -68,6 +68,9 @@ And more *[details][docs-url]*.
|
|
68
68
|
* CircleCI
|
69
69
|
* `ENV['CIRCLE_BRANCH']`
|
70
70
|
* [Environment variables - CircleCI](https://circleci.com/docs/environment-variables#build-details)
|
71
|
+
* Bitrise
|
72
|
+
* `ENV['BITRISE_GIT_BRANCH']`
|
73
|
+
* [Environment variables - Bitrise](https://devcenter.bitrise.io/faq/available-environment-variables/)
|
71
74
|
* GitHub pull request builder plugin (for Jenkins)
|
72
75
|
* `ENV['ghprbSourceBranch']`
|
73
76
|
* [Environment Variables](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables)
|
data/changelog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
<a name="1.3.0"></a>
|
2
|
+
# [1.3.0](https://github.com/packsaddle/ruby-env_branch/compare/v1.2.0...v1.3.0) (2018-07-15)
|
3
|
+
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
* **ci:** support bitrise([7a7a24e](https://github.com/packsaddle/ruby-env_branch/commit/7a7a24e))
|
8
|
+
|
9
|
+
|
10
|
+
|
1
11
|
<a name="1.2.0"></a>
|
2
12
|
# [1.2.0](https://github.com/packsaddle/ruby-env_branch/compare/v1.1.0...v1.2.0) (2016-05-07)
|
3
13
|
|
data/lib/env_branch/base.rb
CHANGED
@@ -40,6 +40,8 @@ module EnvBranch
|
|
40
40
|
# ENV['TRAVIS_BRANCH']
|
41
41
|
# circleci.com:
|
42
42
|
# ENV['CIRCLE_BRANCH']
|
43
|
+
# bitrise.io:
|
44
|
+
# ENV['BITRISE_GIT_BRANCH']
|
43
45
|
# GitHub pull request builder plugin (for Jenkins):
|
44
46
|
# ENV['ghprbSourceBranch']
|
45
47
|
# Git plugin (for Jenkins):
|
@@ -54,6 +56,8 @@ module EnvBranch
|
|
54
56
|
# Environment Variables - Travis CI
|
55
57
|
# @see https://circleci.com/docs/environment-variables#build-details
|
56
58
|
# Environment variables - CircleCI
|
59
|
+
# @see https://devcenter.bitrise.io/faq/available-environment-variables/
|
60
|
+
# Environment variables - Bitrise
|
57
61
|
# @see https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables
|
58
62
|
# Environment Variables
|
59
63
|
# @see https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Environmentvariables
|
@@ -63,6 +67,8 @@ module EnvBranch
|
|
63
67
|
ENV['TRAVIS_BRANCH']
|
64
68
|
elsif ENV['CIRCLE_BRANCH'] && !ENV['CIRCLE_BRANCH'].empty?
|
65
69
|
ENV['CIRCLE_BRANCH']
|
70
|
+
elsif ENV['BITRISE_GIT_BRANCH'] && !ENV['BITRISE_GIT_BRANCH'].empty?
|
71
|
+
ENV['BITRISE_GIT_BRANCH']
|
66
72
|
elsif ENV['ghprbSourceBranch'] && !ENV['ghprbSourceBranch'].empty?
|
67
73
|
ENV['ghprbSourceBranch']
|
68
74
|
elsif ENV['GIT_BRANCH'] && !ENV['GIT_BRANCH'].empty?
|
@@ -23,10 +23,12 @@ module EnvBranch
|
|
23
23
|
def stash_env_branch
|
24
24
|
@original_travis_branch = ENV['TRAVIS_BRANCH']
|
25
25
|
@original_circle_branch = ENV['CIRCLE_BRANCH']
|
26
|
+
@original_bitrise_branch = ENV['BITRISE_GIT_BRANCH']
|
26
27
|
@original_github_pull_request_builder_plugin_branch = ENV['ghprbSourceBranch']
|
27
28
|
@original_git_plugin_branch = ENV['GIT_BRANCH']
|
28
29
|
ENV.delete 'TRAVIS_BRANCH'
|
29
30
|
ENV.delete 'CIRCLE_BRANCH'
|
31
|
+
ENV.delete 'BITRISE_GIT_BRANCH'
|
30
32
|
ENV.delete 'ghprbSourceBranch'
|
31
33
|
ENV.delete 'GIT_BRANCH'
|
32
34
|
end
|
@@ -50,10 +52,12 @@ module EnvBranch
|
|
50
52
|
def restore_env_branch
|
51
53
|
original_travis_branch = (defined?(@original_travis_branch) && @original_travis_branch) || nil
|
52
54
|
original_circle_branch = (defined?(@original_circle_branch) && @original_circle_branch) || nil
|
55
|
+
original_bitrise_branch = (defined?(@original_bitrise_branch) && @original_bitrise_branch) || nil
|
53
56
|
original_github_pull_request_builder_plugin_branch = (defined?(@original_github_pull_request_builder_plugin_branch) && @original_github_pull_request_builder_plugin_branch) || nil
|
54
57
|
original_git_plugin_branch = (defined?(@original_git_plugin_branch) && @original_git_plugin_branch) || nil
|
55
58
|
ENV['TRAVIS_BRANCH'] = original_travis_branch
|
56
59
|
ENV['CIRCLE_BRANCH'] = original_circle_branch
|
60
|
+
ENV['BITRISE_GIT_BRANCH'] = original_bitrise_branch
|
57
61
|
ENV['ghprbSourceBranch'] = original_github_pull_request_builder_plugin_branch
|
58
62
|
ENV['GIT_BRANCH'] = original_git_plugin_branch
|
59
63
|
end
|
data/lib/env_branch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: env_branch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,9 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.7.6
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Get BRANCH_NAME from environment variables.
|
103
103
|
test_files: []
|
104
|
-
has_rdoc:
|