Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit a86488d

Browse files
committed
Look for a REVISION file before running git log
1 parent 96906f2 commit a86488d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ v5.1
55
- Add support for skip branches from build
66
- Add coverage parsing feature
77
- Update rails to 4.0.10
8+
- Look for a REVISION file before running `git log`
89

910
v5.0.1
1011
- Update rails to 4.0.5

config/initializers/2_app.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
module GitlabCi
22
VERSION = File.read(Rails.root.join("VERSION")).strip
3-
REVISION = `git log --pretty=format:'%h' -n 1`
3+
4+
# Try to read the current Git revision from a REVISION file. This is used by
5+
# the omnibus packages.
6+
revision_file = Rails.root.join('REVISION')
7+
if File.exist?(revision_file)
8+
REVISION = File.read(revision_file).strip
9+
else
10+
REVISION = `git log --pretty=format:'%h' -n 1`
11+
end
12+
413
REGISTRATION_TOKEN = SecureRandom.hex(10)
514

615
def self.config

0 commit comments

Comments
 (0)