From d7448f161fd2730b1238285d5f1c8fc72d31b099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Fri, 25 Aug 2017 12:15:27 +0000 Subject: [PATCH] Merge branch 'zj-improve-object-store-rake-task' into 'master' Use proper logging for artifacts rake task See merge request !2762 --- .../unreleased-ee/zj-improve-object-store-rake-task.yml | 5 +++++ lib/tasks/gitlab/artifacts.rake | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased-ee/zj-improve-object-store-rake-task.yml diff --git a/changelogs/unreleased-ee/zj-improve-object-store-rake-task.yml b/changelogs/unreleased-ee/zj-improve-object-store-rake-task.yml new file mode 100644 index 00000000000..70ffaa45bfd --- /dev/null +++ b/changelogs/unreleased-ee/zj-improve-object-store-rake-task.yml @@ -0,0 +1,5 @@ +--- +title: Use a logger for the artifacts migration rake task +merge_request: +author: +type: changed diff --git a/lib/tasks/gitlab/artifacts.rake b/lib/tasks/gitlab/artifacts.rake index e079177eb3f..53514490d59 100644 --- a/lib/tasks/gitlab/artifacts.rake +++ b/lib/tasks/gitlab/artifacts.rake @@ -1,3 +1,5 @@ +require 'logger' + desc "GitLab | Migrate files for artifacts to comply with new storage format" namespace :gitlab do namespace :artifacts do @@ -11,9 +13,10 @@ namespace :gitlab do begin build.artifacts_file.migrate!(ArtifactUploader::REMOTE_STORE) build.artifacts_metadata.migrate!(ArtifactUploader::REMOTE_STORE) - print '.' - rescue - print 'F' + + logger.info("Transferred artifacts of #{build.id} of #{build.artifacts_size} to object storage") + rescue => e + logger.error("Failed to transfer artifacts of #{build.id} with error: #{e.message}") end end end