summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-05-05 16:36:40 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-05-05 16:36:40 +0800
commitae5d4cfeffbeb3b3e5bef53e5b806a7a67189c5c (patch)
tree4c0478870f88b188598c9a72091154a897693cbf
parent82a18ad97761ce867291c48f1fe2f0475c12cfc4 (diff)
downloadgitlab-ce-ae5d4cfeffbeb3b3e5bef53e5b806a7a67189c5c.tar.gz
Backport rake downtime_check otherwise it's not passing
-rw-r--r--lib/tasks/gitlab/db.rake7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake
index 7c96bc864ce..623d2e9e751 100644
--- a/lib/tasks/gitlab/db.rake
+++ b/lib/tasks/gitlab/db.rake
@@ -62,9 +62,10 @@ namespace :gitlab do
ref = Shellwords.escape(args[:ref])
- migrations = `git diff #{ref}.. --name-only -- db/migrate`.lines.
- map { |file| Rails.root.join(file.strip).to_s }.
- select { |file| File.file?(file) }
+ migrations = `git diff #{ref}.. --diff-filter=A --name-only -- db/migrate`.lines
+ .map { |file| Rails.root.join(file.strip).to_s }
+ .select { |file| File.file?(file) }
+ .select { |file| /\A[0-9]+.*\.rb\z/ =~ File.basename(file) }
Gitlab::DowntimeCheck.new.check_and_print(migrations)
end