namespace:gitlabdonamespace:cleanupdodesc"GitLab | Cleanup | Delete moved repositories"taskmoved: :gitlab_environmentdowarn_user_is_not_gitlabremove_flag=ENV['REMOVE']Gitlab.config.repositories.storages.eachdo|name,repository_storage|repo_root=repository_storage.legacy_disk_path.chomp('/')# Look for global repos (legacy, depth 1) and normal repos (depth 2)IO.popen(%W(find #{repo_root} -mindepth 1 -maxdepth 2 -name *+moved*.git))do|find|find.each_linedo|path|path.chomp!ifremove_flagifFileUtils.rm_rf(path)puts"Removed...#{path}".color(:green)elseputs"Cannot remove #{path}".color(:red)endelseputs"Can be removed: #{path}".color(:green)endendendendunlessremove_flagputs"To cleanup these repositories run this command with REMOVE=true".color(:yellow)endendendend