Merge branch 'zj-improve-object-store-rake-task' into 'master'

Use proper logging for artifacts rake task

See merge request !2762
This commit is contained in:
Kamil Trzciński 2017-08-25 12:15:27 +00:00
parent bc76062774
commit d7448f161f
2 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
title: Use a logger for the artifacts migration rake task
merge_request:
author:
type: changed

View file

@ -1,3 +1,5 @@
require 'logger'
desc "GitLab | Migrate files for artifacts to comply with new storage format" desc "GitLab | Migrate files for artifacts to comply with new storage format"
namespace :gitlab do namespace :gitlab do
namespace :artifacts do namespace :artifacts do
@ -11,9 +13,10 @@ namespace :gitlab do
begin begin
build.artifacts_file.migrate!(ArtifactUploader::REMOTE_STORE) build.artifacts_file.migrate!(ArtifactUploader::REMOTE_STORE)
build.artifacts_metadata.migrate!(ArtifactUploader::REMOTE_STORE) build.artifacts_metadata.migrate!(ArtifactUploader::REMOTE_STORE)
print '.'
rescue logger.info("Transferred artifacts of #{build.id} of #{build.artifacts_size} to object storage")
print 'F' rescue => e
logger.error("Failed to transfer artifacts of #{build.id} with error: #{e.message}")
end end
end end
end end