alpha_omega 0.0.125 → 0.0.126
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alpha_omega/utils.rb +4 -5
- data/libexec/proxy +7 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.126
|
data/lib/alpha_omega/utils.rb
CHANGED
@@ -141,9 +141,9 @@ module AlphaOmega
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def self.what_branch (allowed = %w(production staging master develop) + [%r(/)])
|
144
|
-
current = `git
|
145
|
-
if current
|
146
|
-
|
144
|
+
current = `cat .git/HEAD`.strip
|
145
|
+
if current[0] == "ref:"
|
146
|
+
branch_name = current[1].split("/")[2..-1].join("/")
|
147
147
|
if allowed.any? {|rx| rx.match(branch_name) }
|
148
148
|
branch_name
|
149
149
|
else
|
@@ -151,8 +151,7 @@ module AlphaOmega
|
|
151
151
|
abort
|
152
152
|
end
|
153
153
|
else
|
154
|
-
|
155
|
-
abort
|
154
|
+
current[0]
|
156
155
|
end
|
157
156
|
end
|
158
157
|
|
data/libexec/proxy
CHANGED
@@ -4,11 +4,15 @@ hst_proxy="${GATEWAY:=deploy}"
|
|
4
4
|
|
5
5
|
# remote arguments
|
6
6
|
git_url="$(git config --list | grep remote.origin.url | cut -d= -f2-)"
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
git_ref=$(cat .git/HEAD)
|
9
|
+
if echo "$git_ref" | egrep -q "^ref:"; then
|
10
|
+
git_branch=$(echo "$git_ref" | awk '{print $1}' | cut -d/ -f3-)
|
11
|
+
git_head=$(git show-ref --hash "$(echo "$git_ref" | awk '{print $2}')")
|
12
|
+
else
|
9
13
|
git_branch=""
|
14
|
+
git_head=$git_ref
|
10
15
|
fi
|
11
|
-
git_head="$(git show-ref --head HEAD | awk '$2 == "HEAD" {print $1}')"
|
12
16
|
|
13
17
|
if [[ -z $git_head ]]; then
|
14
18
|
echo "ERROR: could not find the SHA for HEAD" 1>&2
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpha_omega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 227
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 126
|
10
|
+
version: 0.0.126
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|