[ARVADOS] updated: ffd589ae2923c98d25f51f34d7394ae09c97e32c
git at public.curoverse.com
git at public.curoverse.com
Thu Sep 24 09:28:38 EDT 2015
Summary of changes:
apps/workbench/config/application.default.yml | 35 ++++++++++++++++-----------
services/api/config/application.default.yml | 35 ++++++++++++++++-----------
2 files changed, 42 insertions(+), 28 deletions(-)
via ffd589ae2923c98d25f51f34d7394ae09c97e32c (commit)
from 44042f1b80c65e09aa94c738c0ac385b365b0669 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ffd589ae2923c98d25f51f34d7394ae09c97e32c
Author: Brett Smith <brett at curoverse.com>
Date: Thu Sep 24 09:28:34 2015 -0400
6967: Fixup to address review comments.
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index c08dfbb..f311437 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -2,24 +2,31 @@
# instead (see application.yml.example).
<%
+# If you change any of the code in this block, you'll probably also want
+# to update it in API server's application.default.yml.
source_version = ""
local_modified = false
-begin
- status_output = false
- IO.popen(["git", "status", "-s"], "r", err: [:child, :out]) do |git_pipe|
- git_pipe.each_line do |_|
- status_output = true
- end
- end
- if $?.success?
- source_version = `git log -n1 --format=%H`.strip
- local_modified = status_output
- else
- raise SystemCallError.new("git exited #{$?.exitstatus}")
- end
-rescue SystemCallError
+if Rails.env == "production"
+ # Read the version from our package's git-commit.version file, if available.
begin
source_version = IO.read(Rails.root.join("git-commit.version")).strip
+ rescue Errno::ENOENT
+ end
+end
+
+if source_version.empty?
+ begin
+ status_output = false
+ IO.popen(["git", "status", "-s"], "r", err: [:child, :out]) do |git_pipe|
+ git_pipe.each_line do |_|
+ status_output = true
+ # Continue reading the pipe so git doesn't get SIGPIPE.
+ end
+ end
+ if $?.success?
+ source_version = `git log -n1 --format=%H`.strip
+ local_modified = status_output
+ end
rescue SystemCallError
end
end
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 28ffddd..fb2a852 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -9,24 +9,31 @@
# 5. Section in application.default.yml called "common"
<%
+# If you change any of the code in this block, you'll probably also want
+# to update it in Workbench's application.default.yml.
source_version = ""
local_modified = false
-begin
- status_output = false
- IO.popen(["git", "status", "-s"], "r", err: [:child, :out]) do |git_pipe|
- git_pipe.each_line do |_|
- status_output = true
- end
- end
- if $?.success?
- source_version = `git log -n1 --format=%H`.strip
- local_modified = status_output
- else
- raise SystemCallError.new("git exited #{$?.exitstatus}")
- end
-rescue SystemCallError
+if Rails.env == "production"
+ # Read the version from our package's git-commit.version file, if available.
begin
source_version = IO.read(Rails.root.join("git-commit.version")).strip
+ rescue Errno::ENOENT
+ end
+end
+
+if source_version.empty?
+ begin
+ status_output = false
+ IO.popen(["git", "status", "-s"], "r", err: [:child, :out]) do |git_pipe|
+ git_pipe.each_line do |_|
+ status_output = true
+ # Continue reading the pipe so git doesn't get SIGPIPE.
+ end
+ end
+ if $?.success?
+ source_version = `git log -n1 --format=%H`.strip
+ local_modified = status_output
+ end
rescue SystemCallError
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list