summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-06 14:02:49 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-06 14:02:49 +0200
commitf915a4b80fdae28492e6c630534d8b66462f670a (patch)
tree54fc70863abcbf119511336732a6bf8335af98bc
parent45ca39e81bf857cdb58b1a184b8fab0e56c200f7 (diff)
downloadgitlab-ce-shell-version-warning.tar.gz
Warn when gitlab-shell version doesn't match requirement.shell-version-warning
-rw-r--r--CHANGELOG1
-rw-r--r--config/initializers/5_backend.rb7
-rw-r--r--lib/gitlab/backend/shell.rb2
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index db3e5744b0e..87675a056bd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -62,6 +62,7 @@ v 7.10.0 (unreleased)
- Project labels are now available over the API under the "tag_list" field (Cristian Medina)
- Fixed link paths for HTTP and SSH on the admin project view (Jeremy Maziarz)
- Fix and improve help rendering (Sullivan Sénéchal)
+ - Warn when gitlab-shell version doesn't match requirement.
v 7.9.2
diff --git a/config/initializers/5_backend.rb b/config/initializers/5_backend.rb
index 7c2e7f39000..80d641d73a3 100644
--- a/config/initializers/5_backend.rb
+++ b/config/initializers/5_backend.rb
@@ -6,3 +6,10 @@ require Rails.root.join("lib", "gitlab", "backend", "shell")
# GitLab shell adapter
require Rails.root.join("lib", "gitlab", "backend", "shell_adapter")
+
+required_version = Gitlab::VersionInfo.parse(Gitlab::Shell.version_required)
+current_version = Gitlab::VersionInfo.parse(Gitlab::Shell.new.version)
+
+unless current_version.valid? && required_version <= current_version
+ warn "WARNING: This version of GitLab depends on gitlab-shell #{required_version}, but you're running #{current_version}. Please update gitlab-shell."
+end
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb
index aabc7f1e69a..530f9d93de4 100644
--- a/lib/gitlab/backend/shell.rb
+++ b/lib/gitlab/backend/shell.rb
@@ -240,7 +240,7 @@ module Gitlab
gitlab_shell_version_file = "#{gitlab_shell_path}/VERSION"
if File.readable?(gitlab_shell_version_file)
- File.read(gitlab_shell_version_file)
+ File.read(gitlab_shell_version_file).chomp
end
end