2020-05-21 20:08:07 -04:00
|
|
|
namespace :gitlab do
|
|
|
|
namespace :container_registry do
|
|
|
|
desc "GitLab | Container Registry | Configure"
|
|
|
|
task configure: :gitlab_environment do
|
2020-06-03 20:08:17 -04:00
|
|
|
configure
|
|
|
|
end
|
|
|
|
|
|
|
|
def configure
|
2020-05-21 20:08:07 -04:00
|
|
|
registry_config = Gitlab.config.registry
|
|
|
|
|
|
|
|
unless registry_config.enabled && registry_config.api_url.presence
|
2020-06-03 20:08:17 -04:00
|
|
|
puts "Registry is not enabled or registry api url is not present.".color(:yellow)
|
|
|
|
return
|
2020-05-21 20:08:07 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
warn_user_is_not_gitlab
|
|
|
|
|
2020-07-08 17:09:09 -04:00
|
|
|
UpdateContainerRegistryInfoService.new.execute
|
2020-05-21 20:08:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|