From 239d942606bd35d90c4546eb7b0fd530baf00a05 Mon Sep 17 00:00:00 2001 From: Bastian Krol Date: Wed, 9 Jul 2014 14:49:53 +0200 Subject: print validation errors when import fails --- lib/tasks/gitlab/import.rake | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake index cbfa736c84c..d38c7a59431 100644 --- a/lib/tasks/gitlab/import.rake +++ b/lib/tasks/gitlab/import.rake @@ -72,6 +72,7 @@ namespace :gitlab do puts " * Created #{project.name} (#{repo_path})".green else puts " * Failed trying to create #{project.name} (#{repo_path})".red + puts " Validation Errors: #{project.errors.messages}".red end end end -- cgit v1.2.1 From e00e67db42ea3e4b994160dbdc288a8effa14713 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 28 Oct 2014 18:52:21 +0100 Subject: Drop all Postgres sequences during backup restore --- lib/tasks/gitlab/db/drop_all_postgres_sequences.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/tasks/gitlab/db/drop_all_postgres_sequences.rake (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake b/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake new file mode 100644 index 00000000000..e9cf0a9b5e8 --- /dev/null +++ b/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake @@ -0,0 +1,10 @@ +namespace :gitlab do + namespace :db do + task drop_all_postgres_sequences: :environment do + connection = ActiveRecord::Base.connection + connection.execute("SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';").each do |sequence| + connection.execute("DROP SEQUENCE #{sequence['relname']}") + end + end + end +end -- cgit v1.2.1 From f36db59d97b375744ee1c05d07792a8d64ae945b Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 5 Nov 2014 17:14:22 +0100 Subject: Factor GITLAB_SHELL_VERSION get method --- lib/tasks/gitlab/check.rake | 10 +++------- lib/tasks/gitlab/shell.rake | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 56e8ff44988..7ff23a7600a 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -574,20 +574,16 @@ namespace :gitlab do Gitlab::Shell.new.version end - def required_gitlab_shell_version - File.read(File.join(Rails.root, "GITLAB_SHELL_VERSION")).strip - end - def gitlab_shell_major_version - required_gitlab_shell_version.split(".")[0].to_i + Gitlab::Shell.version_required.split('.')[0].to_i end def gitlab_shell_minor_version - required_gitlab_shell_version.split(".")[1].to_i + Gitlab::Shell.version_required.split('.')[1].to_i end def gitlab_shell_patch_version - required_gitlab_shell_version.split(".")[2].to_i + Gitlab::Shell.version_required.split('.')[2].to_i end def has_gitlab_shell3? diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 55f338add6a..1e2d64b56c9 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -4,7 +4,7 @@ namespace :gitlab do task :install, [:tag, :repo] => :environment do |t, args| warn_user_is_not_gitlab - default_version = File.read(File.join(Rails.root, "GITLAB_SHELL_VERSION")).strip + default_version = Gitlab::Shell.version_required args.with_defaults(tag: 'v' + default_version, repo: "https://gitlab.com/gitlab-org/gitlab-shell.git") user = Gitlab.config.gitlab.user -- cgit v1.2.1 From 586590d20ed7e47465460c0fbcd0df1b9ea45afc Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 5 Nov 2014 17:24:20 +0100 Subject: Remove unused has_gitlab_shell3? method --- lib/tasks/gitlab/check.rake | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 56e8ff44988..f2705256f73 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -589,10 +589,6 @@ namespace :gitlab do def gitlab_shell_patch_version required_gitlab_shell_version.split(".")[2].to_i end - - def has_gitlab_shell3? - gitlab_shell_version.try(:start_with?, "v3.") - end end -- cgit v1.2.1 From e4a38e447169069f3d5042d3341ceb4bdc51bf1b Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 5 Nov 2014 17:51:08 +0100 Subject: Factor using Repository#path_to_repo --- lib/tasks/gitlab/shell.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 55f338add6a..6b8f9e377fe 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -76,7 +76,7 @@ namespace :gitlab do desc "GITLAB | Build missing projects" task build_missing_projects: :environment do Project.find_each(batch_size: 1000) do |project| - path_to_repo = File.join(Gitlab.config.gitlab_shell.repos_path, "#{project.path_with_namespace}.git") + path_to_repo = project.repository.path_to_repo if File.exists?(path_to_repo) print '-' else -- cgit v1.2.1 From 1f902c2464a4f5c68f1b42be597d4e3e25a32130 Mon Sep 17 00:00:00 2001 From: Marvin Frick Date: Wed, 12 Nov 2014 12:06:24 +0100 Subject: fixes the `block_removed_ldap_users` rake task In e23a26a (and later 1bc9936) the API for Gitlab::LDAP::Adapter was changed. I assume this rake task was an oversight in the refactoring of the changed class. While being on it, I noticed that already blocked users cannot be blocked again. --- lib/tasks/gitlab/cleanup.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index 63dcdc52370..189ad6090a4 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -92,11 +92,11 @@ namespace :gitlab do User.ldap.each do |ldap_user| print "#{ldap_user.name} (#{ldap_user.extern_uid}) ..." - if Gitlab::LDAP::Access.open { |access| access.allowed?(ldap_user) } + if Gitlab::LDAP::Access.allowed?(ldap_user) puts " [OK]".green else if block_flag - ldap_user.block! + ldap_user.block! unless ldap_user.blocked? puts " [BLOCKED]".red else puts " [NOT IN LDAP]".yellow -- cgit v1.2.1 From 533f4cdf30b38c587f7a91f0dfd898b907ecd944 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 22 Oct 2014 10:54:59 +0200 Subject: gitlab shell works if multiple rubies installed Before this it would fail because git hooks automatically prepend things to the path, which can lead the wrong Ruby version to be called in which dependencies are not installed. To make sure that this is correct, the forked_merge_requests commented out test that depends on this change was uncommented. For that test to pass, it is also necessary to setup the mock server on port 3001 under test_env.rb. --- lib/tasks/gitlab/shell.rake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 202e55c89ad..d3cc7135c54 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -22,10 +22,14 @@ namespace :gitlab do # Make sure we're on the right tag Dir.chdir(target_dir) do + # Allows to change the origin URL to the fork + # when developing gitlab-shell. + sh(*%W(git remote set-url origin #{args.repo})) + # First try to checkout without fetching # to avoid stalling tests if the Internet is down. - reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})" - sh "#{reset} || git fetch origin && #{reset}" + reset = "(rev=\"$(git describe #{args.tag} || git describe \"origin/#{args.tag}\")\" && git reset --hard \"$rev\")" + sh "#{reset} || (git fetch --tags origin && #{reset})" config = { user: user, @@ -37,7 +41,7 @@ namespace :gitlab do bin: %x{which redis-cli}.chomp, namespace: "resque:gitlab" }.stringify_keys, - log_level: "INFO", + log_level: Rails.env.test? ? 'DEBUG' : 'INFO', audit_usernames: false }.stringify_keys @@ -66,6 +70,8 @@ namespace :gitlab do File.open(File.join(home_dir, ".ssh", "environment"), "w+") do |f| f.puts "PATH=#{ENV['PATH']}" end + + Gitlab::Shell.setup_secret_token end desc "GITLAB | Setup gitlab-shell" -- cgit v1.2.1 From f7bf892cca6bb8106194c14bef1ed9ddfc26ec91 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 18 Nov 2014 17:14:36 +0200 Subject: Revert "gitlab shell works if multiple rubies installed" This reverts commit 533f4cdf30b38c587f7a91f0dfd898b907ecd944. --- lib/tasks/gitlab/shell.rake | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index d3cc7135c54..202e55c89ad 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -22,14 +22,10 @@ namespace :gitlab do # Make sure we're on the right tag Dir.chdir(target_dir) do - # Allows to change the origin URL to the fork - # when developing gitlab-shell. - sh(*%W(git remote set-url origin #{args.repo})) - # First try to checkout without fetching # to avoid stalling tests if the Internet is down. - reset = "(rev=\"$(git describe #{args.tag} || git describe \"origin/#{args.tag}\")\" && git reset --hard \"$rev\")" - sh "#{reset} || (git fetch --tags origin && #{reset})" + reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})" + sh "#{reset} || git fetch origin && #{reset}" config = { user: user, @@ -41,7 +37,7 @@ namespace :gitlab do bin: %x{which redis-cli}.chomp, namespace: "resque:gitlab" }.stringify_keys, - log_level: Rails.env.test? ? 'DEBUG' : 'INFO', + log_level: "INFO", audit_usernames: false }.stringify_keys @@ -70,8 +66,6 @@ namespace :gitlab do File.open(File.join(home_dir, ".ssh", "environment"), "w+") do |f| f.puts "PATH=#{ENV['PATH']}" end - - Gitlab::Shell.setup_secret_token end desc "GITLAB | Setup gitlab-shell" -- cgit v1.2.1 From 7c54c63ac14eb8f5ce0e364d709988fcfe4dda64 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 20 Nov 2014 15:46:04 +0100 Subject: Add CRON=1 backup setting for quiet backups --- lib/tasks/gitlab/backup.rake | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 2eff1260b61..99e84f62c66 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -6,6 +6,7 @@ namespace :gitlab do desc "GITLAB | Create a backup of the GitLab system" task create: :environment do warn_user_is_not_gitlab + configure_cron_mode Rake::Task["gitlab:backup:db:create"].invoke Rake::Task["gitlab:backup:repo:create"].invoke @@ -21,6 +22,7 @@ namespace :gitlab do desc "GITLAB | Restore a previously created backup" task restore: :environment do warn_user_is_not_gitlab + configure_cron_mode backup = Backup::Manager.new backup.unpack @@ -35,43 +37,52 @@ namespace :gitlab do namespace :repo do task create: :environment do - puts "Dumping repositories ...".blue + $progress.puts "Dumping repositories ...".blue Backup::Repository.new.dump - puts "done".green + $progress.puts "done".green end task restore: :environment do - puts "Restoring repositories ...".blue + $progress.puts "Restoring repositories ...".blue Backup::Repository.new.restore - puts "done".green + $progress.puts "done".green end end namespace :db do task create: :environment do - puts "Dumping database ... ".blue + $progress.puts "Dumping database ... ".blue Backup::Database.new.dump - puts "done".green + $progress.puts "done".green end task restore: :environment do - puts "Restoring database ... ".blue + $progress.puts "Restoring database ... ".blue Backup::Database.new.restore - puts "done".green + $progress.puts "done".green end end namespace :uploads do task create: :environment do - puts "Dumping uploads ... ".blue + $progress.puts "Dumping uploads ... ".blue Backup::Uploads.new.dump - puts "done".green + $progress.puts "done".green end task restore: :environment do - puts "Restoring uploads ... ".blue + $progress.puts "Restoring uploads ... ".blue Backup::Uploads.new.restore - puts "done".green + $progress.puts "done".green + end + end + + def configure_cron_mode + if ENV['CRON'] + require 'stringio' + $progress = StringIO.new + else + $progress = $stdout end end end # namespace end: backup -- cgit v1.2.1 From 458f8c1f80ff20ba3d6e439c65500ed1c1d81ba4 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 20 Nov 2014 15:54:39 +0100 Subject: Explain why we create a StringIO --- lib/tasks/gitlab/backup.rake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 99e84f62c66..0230fbb010b 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -79,6 +79,8 @@ namespace :gitlab do def configure_cron_mode if ENV['CRON'] + # We need an object we can say 'puts' and 'print' to; let's use a + # StringIO. require 'stringio' $progress = StringIO.new else -- cgit v1.2.1 From cdc62cffcb86dfd939c119cba2acaf266af39f23 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 4 Dec 2014 15:22:10 +0100 Subject: Add rake task for google schema whitelisting. --- .../gitlab/mail_google_schema_whitelisting.rake | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 lib/tasks/gitlab/mail_google_schema_whitelisting.rake (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/mail_google_schema_whitelisting.rake b/lib/tasks/gitlab/mail_google_schema_whitelisting.rake new file mode 100644 index 00000000000..f40bba24da8 --- /dev/null +++ b/lib/tasks/gitlab/mail_google_schema_whitelisting.rake @@ -0,0 +1,73 @@ +require "#{Rails.root}/app/helpers/emails_helper" +require 'action_view/helpers' +extend ActionView::Helpers + +include ActionView::Context +include EmailsHelper + +namespace :gitlab do + desc "Email google whitelisting email with example email for actions in inbox" + task mail_google_schema_whitelisting: :environment do + subject = "Rails | Implemented feature" + url = "#{Gitlab.config.gitlab.url}/base/rails-project/issues/#{rand(1..100)}#note_#{rand(10..1000)}" + schema = email_action(url) + body = email_template(schema, url) + mail = Notify.test_email("schema.whitelisting+sample@gmail.com", subject, body.html_safe) + if send_now + mail.deliver + else + puts "WOULD SEND:" + end + puts mail + end + + def email_template(schema, url) + " + + + + GitLab + + + + + +
+
+

I like it :+1:

+
+
+ + + + " + end + + def send_now + if ENV['SEND'] == "true" + true + else + false + end + end +end -- cgit v1.2.1 From cd4c65c159627ead220bcadbe1a58ced0017851b Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 11 Dec 2014 13:17:43 +0100 Subject: Use shell invocation according to the shell commands guidelines. --- lib/tasks/gitlab/shell.rake | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 202e55c89ad..84bc9e304b6 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -17,15 +17,19 @@ namespace :gitlab do # Clone if needed unless File.directory?(target_dir) - sh(*%W(git clone #{args.repo} #{target_dir})) + Gitlab::Popen.popen(%W(git clone -- #{args.repo} #{target_dir})) end # Make sure we're on the right tag Dir.chdir(target_dir) do # First try to checkout without fetching # to avoid stalling tests if the Internet is down. - reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})" - sh "#{reset} || git fetch origin && #{reset}" + reset_status = reset_to_commit(args) + + if reset_status != 0 + Gitlab::Popen.popen(%W(git fetch origin)) + reset_to_commit(args) + end config = { user: user, @@ -54,7 +58,7 @@ namespace :gitlab do File.open("config.yml", "w+") {|f| f.puts config.to_yaml} # Launch installation process - sh "bin/install" + Gitlab::Popen.popen(%W(bin/install)) end # Required for debian packaging with PKGR: Setup .ssh/environment with @@ -118,5 +122,17 @@ namespace :gitlab do puts "Quitting...".red exit 1 end + + def reset_to_commit(args) + tag, status = Gitlab::Popen.popen(%W(git describe -- #{args.tag})) + + if status != 0 + tag, status = Gitlab::Popen.popen(%W(git describe -- origin/#{args.tag})) + end + + tag = tag.strip + reset, reset_status = Gitlab::Popen.popen(%W(git reset --hard #{tag})) + reset_status + end end -- cgit v1.2.1 From bd43cf065384745e4386237ad0f5d4eb14868034 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 12 Dec 2014 10:17:07 +0100 Subject: Use system where only return result is needed. --- lib/tasks/gitlab/shell.rake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 84bc9e304b6..ce5bec39c9d 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -17,17 +17,17 @@ namespace :gitlab do # Clone if needed unless File.directory?(target_dir) - Gitlab::Popen.popen(%W(git clone -- #{args.repo} #{target_dir})) + system(%W(git clone -- #{args.repo} #{target_dir})) end # Make sure we're on the right tag Dir.chdir(target_dir) do # First try to checkout without fetching # to avoid stalling tests if the Internet is down. - reset_status = reset_to_commit(args) + reseted = reset_to_commit(args) - if reset_status != 0 - Gitlab::Popen.popen(%W(git fetch origin)) + unless reseted + system(%W(git fetch origin)) reset_to_commit(args) end @@ -58,7 +58,7 @@ namespace :gitlab do File.open("config.yml", "w+") {|f| f.puts config.to_yaml} # Launch installation process - Gitlab::Popen.popen(%W(bin/install)) + system(%W(bin/install)) end # Required for debian packaging with PKGR: Setup .ssh/environment with @@ -126,13 +126,12 @@ namespace :gitlab do def reset_to_commit(args) tag, status = Gitlab::Popen.popen(%W(git describe -- #{args.tag})) - if status != 0 + unless status.zero? tag, status = Gitlab::Popen.popen(%W(git describe -- origin/#{args.tag})) end tag = tag.strip - reset, reset_status = Gitlab::Popen.popen(%W(git reset --hard #{tag})) - reset_status + system(%W(git reset --hard #{tag})) end end -- cgit v1.2.1 From e5951cf4aec15fc58730f88454d2b6d71ff25802 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 12 Dec 2014 10:42:55 +0100 Subject: Don't forget to splat. --- lib/tasks/gitlab/shell.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index ce5bec39c9d..9af93300e08 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -17,7 +17,7 @@ namespace :gitlab do # Clone if needed unless File.directory?(target_dir) - system(%W(git clone -- #{args.repo} #{target_dir})) + system(*%W(git clone -- #{args.repo} #{target_dir})) end # Make sure we're on the right tag @@ -27,7 +27,7 @@ namespace :gitlab do reseted = reset_to_commit(args) unless reseted - system(%W(git fetch origin)) + system(*%W(git fetch origin)) reset_to_commit(args) end @@ -58,7 +58,7 @@ namespace :gitlab do File.open("config.yml", "w+") {|f| f.puts config.to_yaml} # Launch installation process - system(%W(bin/install)) + system(*%W(bin/install)) end # Required for debian packaging with PKGR: Setup .ssh/environment with @@ -131,7 +131,7 @@ namespace :gitlab do end tag = tag.strip - system(%W(git reset --hard #{tag})) + system(*%W(git reset --hard #{tag})) end end -- cgit v1.2.1 From 18d9172edc3bb3a1cfd7640ea0555e887ce5bde5 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 22 Dec 2014 10:03:52 +0100 Subject: Use a different name of the method to check if sanitize is enabled in check task. --- lib/tasks/gitlab/check.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 1da5f4b980f..43115915de1 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -786,14 +786,14 @@ namespace :gitlab do end def sanitized_message(project) - if sanitize + if should_sanitize? "#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... " else "#{project.name_with_namespace.yellow} ... " end end - def sanitize + def should_sanitize? if ENV['SANITIZE'] == "true" true else -- cgit v1.2.1 From cd688a60111853f63413a87ad6632ad57368e886 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sun, 19 Oct 2014 16:09:38 +0200 Subject: Replace regex methods by string ones since faster and more readable. --- lib/tasks/gitlab/import.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake index 3c693546c09..fef2afd7333 100644 --- a/lib/tasks/gitlab/import.rake +++ b/lib/tasks/gitlab/import.rake @@ -25,7 +25,7 @@ namespace :gitlab do puts "Processing #{repo_path}".yellow - if path =~ /\.wiki\Z/ + if path.end_with?('.wiki') puts " * Skipping wiki repo" next end -- cgit v1.2.1 From f8b97b454b8eae343bd7ea6e92fd2257eeae45b0 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Wed, 14 Jan 2015 21:12:16 -0800 Subject: Make view link come first so I don't have to mouse to the end of the email line. --- lib/tasks/gitlab/mail_google_schema_whitelisting.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/mail_google_schema_whitelisting.rake b/lib/tasks/gitlab/mail_google_schema_whitelisting.rake index f40bba24da8..102c6ae55d5 100644 --- a/lib/tasks/gitlab/mail_google_schema_whitelisting.rake +++ b/lib/tasks/gitlab/mail_google_schema_whitelisting.rake @@ -54,8 +54,8 @@ namespace :gitlab do -- cgit v1.2.1 From 23c31a0b12eaae7f7f25f30eca1066968bcb6059 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 29 Jan 2015 23:06:43 -0800 Subject: Skip tricky test for semaphore --- lib/tasks/spinach.rake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/tasks') diff --git a/lib/tasks/spinach.rake b/lib/tasks/spinach.rake index 507b315759d..ac885f315b9 100644 --- a/lib/tasks/spinach.rake +++ b/lib/tasks/spinach.rake @@ -2,9 +2,15 @@ Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach') desc "GITLAB | Run spinach" task :spinach do + tags = if ENV['SEMAPHORE'] + '~@tricky,~@wip' + else + '~@wip' + end + cmds = [ %W(rake gitlab:setup), - %W(spinach), + %W(spinach --tags #{tags}), ] run_commands(cmds) end -- cgit v1.2.1 From b21565f18d297c167f05f4c7861e01c916c15682 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 29 Jan 2015 23:28:38 -0800 Subject: Fix semaphore spinach tags --- lib/tasks/spinach.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/spinach.rake b/lib/tasks/spinach.rake index ac885f315b9..4aefc18ce14 100644 --- a/lib/tasks/spinach.rake +++ b/lib/tasks/spinach.rake @@ -3,9 +3,9 @@ Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach') desc "GITLAB | Run spinach" task :spinach do tags = if ENV['SEMAPHORE'] - '~@tricky,~@wip' + '~@tricky' else - '~@wip' + '~@semaphore' end cmds = [ -- cgit v1.2.1 From 84a5a548a5e1377f34b7989fc546eaedf86c3510 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 2 Feb 2015 20:08:23 -0800 Subject: Add rubocop to rake test and rake test_ci --- lib/tasks/gitlab/test.rake | 1 + lib/tasks/rubocop.rake | 2 ++ lib/tasks/test.rake | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/rubocop.rake (limited to 'lib/tasks') diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake index c01b00bd1c0..b4076f8238f 100644 --- a/lib/tasks/gitlab/test.rake +++ b/lib/tasks/gitlab/test.rake @@ -2,6 +2,7 @@ namespace :gitlab do desc "GITLAB | Run all tests" task :test do cmds = [ + %W(rake rubocop), %W(rake spinach), %W(rake spec), %W(rake jasmine:ci) diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake new file mode 100644 index 00000000000..c28e529f86d --- /dev/null +++ b/lib/tasks/rubocop.rake @@ -0,0 +1,2 @@ +require 'rubocop/rake_task' +RuboCop::RakeTask.new diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 583f4a876da..3ea9290a814 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -9,5 +9,5 @@ unless Rails.env.production? require 'coveralls/rake/task' Coveralls::RakeTask.new desc "GITLAB | Run all tests on CI with simplecov" - task :test_ci => [:spinach, :spec, 'coveralls:push'] + task :test_ci => [:rubocop, :spinach, :spec, 'coveralls:push'] end -- cgit v1.2.1 From 655fbc6bddb1d5f8df3e50f2896e5c6c276628b8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 3 Feb 2015 19:25:57 -0800 Subject: Dont load rubocop in prod env --- lib/tasks/rubocop.rake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake index c28e529f86d..ddfaf5d51f2 100644 --- a/lib/tasks/rubocop.rake +++ b/lib/tasks/rubocop.rake @@ -1,2 +1,4 @@ -require 'rubocop/rake_task' -RuboCop::RakeTask.new +unless Rails.env.production? + require 'rubocop/rake_task' + RuboCop::RakeTask.new +end -- cgit v1.2.1